Forum Moderators: phranque

Message Too Old, No Replies

Redirect / 404

When I try to use redirect, I keep getting 404 error.

         

CanadaChris

8:07 pm on Jan 13, 2002 (gmt 0)



Hello...

I've looked for a similar problem, but no luck so far.

I'm trying to use .htaccess to redirect a few links to pages within a different domain.

Unless the file exists on MY server, Apache generates a 404 instead of redirecting. If the file does exist on my server, the redirect works fine.

eg:
Redirect 301 /search_e.html [aaa.com...]

It will only redirect to aaa.com if search_e.html is found on MY server.

PLEASE HELP!!!

Key_Master

8:13 pm on Jan 13, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Create some error pages and use ErrorDocument in your .htaccess file. Example:

ErrorDocument 403 /your_error_403_page.html
ErrorDocument 404 /your_error_404_page.html
ErrorDocument 500 /your_error_500_page.html

justa

1:20 am on Jan 15, 2002 (gmt 0)

10+ Year Member



Why don't you add the redirect code directly to the page?

bobriggs

2:00 am on Jan 15, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just curious. Do you also have an ErrorDocument 404 already? If so the problem might be that the redirect needs to come first, but I've not tried this.

And what happens if you add a trailing slash to aaa.com/ ?

CanadaChris

8:31 pm on Jan 15, 2002 (gmt 0)



Key_master - I already have custom ErrorDocuments. It's displaying them instead of redirecting.

justa - I want to delete the pages in question. Adding a redirect to them doesn't suit the purpose.

bobriggs - I do have the custom 404. I tried moving the redirect up and also tried removing the ErrorDocuments altogether. No luck. None with the trailing slash either.

Again, the redirect works when the document I'm trying to direct away from is present. It's not displayed, the redirect just goes through. It's when I physically delete the document I'm trying to direct away from that I get the 404. Weird...

mdharrold

1:52 am on Jan 17, 2002 (gmt 0)

10+ Year Member



Have you tried Redirect /search_e.html [aaa.com...] without the 301?

CanadaChris

6:15 pm on Jan 17, 2002 (gmt 0)



I tried using the Options All tag to turn everything on and that seems to work. I just need to find out what option it is that needs to be turned on now... :)

Thanks for all of the suggestions folks, they were helpful!