View Single Post
  #1 (permalink)  
Old 06-28-2006, 09:33 PM
Dan Dan is offline
Programmer
 
Join Date: Jun 2006
Posts: 145
Credits: 0
Rep Power: 9
Dan is on a distinguished road
Default The Ultimate ASP/ASP.net 301 direct/forwarding thread!

If you don't know what a ASP/ASP.net 301 redirect is, you will by the end of this thread! If you need to redirect a page, unfortunately it isn't as simple as using one of the various methods - only the 301 redirect will preserve search engine rankings for the page. It is the most efficient, search engine friendly method for website redirection - the code 301 is interpreted as "moved permanently".

ASP 301 Redirect Code:

Code:
<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently" Response.AddHeader "Location", " http://www.new-url.com"
>
ASP.net 301 Redirect Code:

Code:
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://www.new-url.com");
}
</script>
Reply With Quote

Sponsored Links