301 Redirect in ASP & ASP.net

The goal of configuration redirect for the website is to prevent a potentially duplicate of the links in the website, leading to the search engine index is not uniform, and distributed power network SEO of the whole. With the use of Open Source made as php joomla or wordpress then apply the 301 redirect function is quite easy to use file . Htaccess configured on the linux server.
But in ASP and ASP.net is a different story, because the different structures and runs on windows server (not to be used. Htaccess file). Lead to information on the use 301 redirect ASP & ASP.net for not much. Today also happened to work with some customers using asp website so I would like to share with you some tips and tricks in duplicate prevention segment content in this website.
The use is quite simple, you just add the following code into the file or index.asp index.aspx is ok.

1. 301 Redirect with ASP

<% @ Language = VBScript%>
<%
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", "http://seo-ho.blogspot.com/"
%>

2. 301 Redirect for ASP.net

<script runat="server">
private void Page_Load (object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader ("Location", "http://seo-ho.blogspot.com/");
}
</ Script>

3. Redirect from / index.asp, / index.aspx on domain.com /

This feature helps you remove the website of the rest of the duplicate index and link it has no index.
To remove or index.asp. Aspx you add the following code to the file or index.asp index.aspx

If LCase (Left (Request.ServerVariables ("HTTP_HOST"), 4)) <> "www." then
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", "http://seo-ho.blogspot.com/"
Response.End
End If
With their shallow knowledge of ASP applications on the part probably will have many flaws, expect to receive your comments in this programming language.
Hopefully the information above will help a lot for your website in asp optimized for search engines.


1 nhận xét:

Unknown said...

hey my site is giving blank page after writing it.
what is the possible reason?
web hosting services

Post a Comment