Forum Moderators: phranque

Message Too Old, No Replies

301 redirects working and not working?!

same code, some work, some don't!

         

Pricey

8:39 am on May 21, 2004 (gmt 0)

10+ Year Member



Hi,

I've recently started playing around with htaccess, as I decided to make a custom 404 page and at the same time I wanted to rename some of my pages (from blue.shtml to blue_widget.shtml)

I started with about 5 pages with 301's and the 404. I then changed some more pages and added them as 301's. These are NOT working, if I try the old page name in the url, it just brings up the 404 page. All 5 of the old 301's still work fine though. The code is exactly the same for every redirect I really can't understand it. When I header check the new 301's, they are returned as 302 Found, and bring up the 404 page. Here is the code:

redirect 301 blue.shtml [blahblah.co.uk...]

ErrorDocument 404 [blahblah.co.uk...]

Pricey

9:52 am on May 21, 2004 (gmt 0)

10+ Year Member



Ok, I just removed my .htaaccess file completley from my server, but the server header check still tells me that my origional redirects are still working and the newer ones are still going to the 404 page.

How can this be when I have removed the htaccess file?!

jdMorgan

2:12 pm on May 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Pricey,

I believe you may find your answer in your other thread [webmasterworld.com]. However, I want to point out that your ErrorDocument format is incorrect, and may lead to major problems with your listing in search engines. The code as you have written it, will return a 302-Found (Moved Temporarily) redirect for any page which is missing on your server, instead of the desired 404-Not Found.

The correct format is


ErrorDocument 404 /404error.shtml

See the ErrorDocument documentation [httpd.apache.org] for more details on how and why this change in response code happens.

Jim