SE's and HTTP 301 Status/Message

Posted By: johnak ()
Posted On: 2004-Aug-11 01:55

I'm working on implementing a 301 re-direct on our site. After some playing around I found if I do it in IIS, IIS returns a "301 Error". Everywhere else I've looked says to set it to "301 Moved Permanently". Do the SE's care about the message or just the status code?

Appreciate any help...

John


Posted By: g1smd (Staff)
Posted On: 2004-Aug-11 21:11

What they read is the code and words in the HTTP header... the stuff that the server sends before it sends out any HTML page after.

Use an online HTTP sniffer to see exactly what is being sent in the HTTP header.


Posted By: landyman ()
Posted On: 2004-Aug-13 01:57

Johnak -
I also had this problem with the "301 Error". After I received it, the old site was banned from Google and the new one was never indexed. After checking for every possible violation, the 301 error was all I could come up with as a problem. I know that they check the status codes, but the status text that is returned was a source of discussion. I believe that SE's look at the status text also. I would recommend getting it to return a "Moved Permanently".

I got it to return the correct code and text and the site was indexed. It took just over 2 months to get the new site indexed. I'm pretty sure this was the reason, however, since this is the only thing we changed on the old or new sites.

I hope this helps you out a little.


Posted By: g1smd (Staff)
Posted On: 2004-Aug-26 22:04

I got it to return the correct code


How did you do that? What exactly did you do?


Posted By: landyman ()
Posted On: 2004-Aug-27 23:21

Since the old site was all in html, I associated the html pages to be read through the ASP engine.
To do this, open up the IIS manager. Right Click on the website you want to edit (the old one, in this case) and choose "properties". Click on the "Home Directory" tab. Click the "Configuration" button and a new window will open with the extensions and their associated .dll files. Add a new extension mapping by pressing the "Add" button. Put in .html for the extension field, and then put the .asp information for the other fields.
Now, .html files will be parsed with the asp engine.

After that, I put asp code at the top of the pages that did the redirect and returned the correct text:
<%
Response.Status = “301 Moved Permanently”
Response.addheader "Location", "http://www.newdomain.com/newdirectory/newpage.html"
Response.End
%>

Doing this got the redirect to show up properly.



Posted By: g1smd (Staff)
Posted On: 2004-Aug-28 08:25

Useful info.


Anyone want to add the equivalent PHP code (for those with PHP on Apache, but without access to the .htaccess file)?


Posted By: seo tester ()
Posted On: 2004-Aug-29 05:59

I believe this will do it in PHP:

<?php

header("HTTP/1.1 301 Moved Permanently"wink;
header("Location: http://www.domain.com/page.html"wink;
exit();

?>


Posted By: wwf ()
Posted On: 2004-Aug-30 08:25

Hi
It may be.Actually 301 error is for permanent redirection and 302 error for temprory redirection in apache .

[ Message was edited by: wwf 08/30/2004 01:48 am ]




Posted By: g1smd (Staff)
Posted On: 2004-Aug-30 19:18

Yes. That is what 301 and 302 do.


If you want to tell the search engine that your site or page has moved, and get the new one reindexed in its place, then you must use a 301 redirect.