View Full Version : How to get both redirection & 404 errors working using htaccess?
RealNames
02-25-2004, 07:45 PM
Anyone know how to setup BOTH 404 error code htaccess and also an htaccess for redirect/forwarding?
It seems like I can only do one or the other, since the files both need to be named the same htaccess. I also tried combining both the error code and the redirect lines in one file but it did not work.
If that can not be done using htaccess, is there perhaps a different way to do so? Thanks.
ProWebUK
02-26-2004, 12:32 AM
just put both lines in the 1 .htaccess
Redirect /file.htm http://yoursite.com/
ErrorDocument 404 /errors/404.htm
ErrorDocument 500 /errors/500.htm
Chris
RealNames
02-26-2004, 09:38 AM
Originally posted by ProWebUK just put both lines in the 1 .htaccess
Redirect /file.htm http://yoursite.com/
ErrorDocument 404 /errors/404.htm
ErrorDocument 500 /errors/500.htm
Thanks but it does not work! As I said, already tried combining the code in the past and always failed. The redirect works but not the error codes.
If your go to www.redirname.com the redirect to domainname.com works. But if you go to www.redirname.com/test.htm it fails to redirect to the domainname index page as I want it to do, instead giving the 404 page not found error.
As a test, also tried putting the redirect line last (not sure if that would make a difference or not), and that did not help. Here is my code:
Redirect / http://www.domainname.com/
ErrorDocument 404 http://www.domaindame.com
ErrorDocument 400 http://www.domainname.com
ErrorDocument 500 http://www.domainname.com
RealNames
02-28-2004, 09:24 PM
Still does not work, anyone help me?
It's real important. Thx!
Kiwi_Tech
03-01-2004, 11:23 AM
did ya get it working? if so what did ya have to change?
i see http://www.domainname.com/teletubbies_rock puts me at main page
Powered by vBulletin™ Version 4.0.4 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.