Forum Moderators: phranque

Message Too Old, No Replies

Permanent Redirect question

Having problem setting 301 for our old domain name.

         

dpacweb

9:21 pm on Jun 9, 2003 (gmt 0)



I would like to put a permanent redirect on an old domain for google search purposes. I did create a simple page, I did insert this code:

<%
Response.Status = "301 Moved Permanently"
Response.addheader "Location", "http://www.newdomain.com/newurl/"
Response.End
%>

at the bottom of the page.
My question is, the page seem to redirect but it goes directly to the new url without seeing the pause page saying that this domain has been changed?

How do I get the pause to see the page?

Thanks

Birdman

5:38 pm on Jun 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can do a meta-refresh to get that effect. The number after "content=" is the amount of seconds the page will show.

<HTML>
<HEAD>
<META HTTP-EQUIV="refresh" content="2;URL=http://www.yoursite.com/newpage.htm">
<TITLE>Page has moved</TITLE>
</HEAD>
<BODY>
whatever you want to write
</BODY>
</HTML>

Ally_Cat

5:56 pm on Jun 10, 2003 (gmt 0)

10+ Year Member



Forgive me if I'm missing something, but isn't a meta refresh a temporary redirect?

Ally_Cat

6:02 pm on Jun 10, 2003 (gmt 0)

10+ Year Member



Also:

If I wanted to use the first example - could I set up .txt files with that code named as the pages I want to redirect, on the root of my server? What else would need to be added to create the proper redirect?

Birdman

6:10 pm on Jun 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It actually returns a 200 OK response header. It's the only way if you want the old page to display first. I would just stick with a server-side redirect, like you have now. Use this site's Server Header Check [webmasterworld.com] to be sure you are getting the correct response. It's a cool tool!

universalis

6:19 pm on Jun 10, 2003 (gmt 0)

10+ Year Member



Forgive me if I'm missing something, but isn't a meta refresh a temporary redirect?

A meta refresh is not the same as a 301 redirect - but you are missing something: when the server issues a 301 redirect, it tells the user agent that the page is no longer there and has been moved permanently. So, there can be no content or pause as if there is content, the page still exists. If you want to tell your users that the page has moved, then a meta refresh is the only way - but the old domain would still be indexed unless you put this on the page as well:

<meta name="robots" content="noindex,follow">

Make sure you have a standard link to your new domain on your redirect page for the robot to follow (robots don't follow meta refreshes).

As for redirecting your whole site, I can give you the Apache .htaccess code, but as it appears you are using ASP I assume you have a Windows/IIS server - I'm sure one of the many Windows experts will be able to give you the answer.

<edit reason: beaten to it! />