Thread: 301 Redirects
View Single Post
  #11 (permalink)  
Old 04-01-2005, 10:46 AM
Sting25 Sting25 is offline
WebProWorld New Member
 
Join Date: Aug 2004
Location: Denver Colorado
Posts: 3
Sting25 RepRank 0
Default ASP redirect to change your URL

I did the same thing last year. My new domain took all my ranking from my primary domain.. You can do this redirect very easy.

Set up new hosting for the domain you would like to remove on an asp server... duplicate your site onto the new hosting. Include this code at the top of each page of the new hosting. Then change your DNS of the domain to point to the new hosting.

<%
Dim NewURL, Referer1
'Replace with the correct address for the page
NewURL = "www.yourdomain.com/landingpage.asp"

'This gets the current page url
Referer1 = Trim(Request.ServerVariables("URL"))

'This sets the response header to 401 and redirects the page
response.status = "401 Object Moved"
response.addheader referer1, "" & NewUrl & ""
Response.redirect(NewURL)
response.end
%>

This will send a 401 (permenant) redirect to the search engines as they spider the pages and tell them to change thier link to the correct location And redirects

This is also easily tied to a database for very large sites.


Hope this helps

Chris
Reply With Quote