Forum Moderators: phranque

Message Too Old, No Replies

.htaccess

Correct configuration of server apache

         

KarlDoenitz

12:40 am on Dec 1, 2002 (gmt 0)

10+ Year Member



Hi, my name is Nicolás and i'm from Argentina... i've experienced recently a change of hosting, and as a consequence, many links at google.com and other search engines are now broken. Therefore, i had to break my brain in order to rescue some of my ex-visitors that were now heading directly to a 404 error... The way i solved it were configuring .htaccess and creating a personaliced 404 error message that helped me quite well, but not enough. nice story, but... i still cant get a personaliced 404 error "by folder" as i wish. So i please ask for your help.
Basically, now, all visitors who type [mysite.com...] (that doesn't actually exists) are redirected to an html called error.html, but i would like to have many of those "error.html" one for each folder my server has... so when somebody types [mysite.com...] he gets an error1.html and if he types [mysite.com...] he gets an error2.html and so on... I tried putting an personaliced .htaccess for each folder but it didn't work out. PLEASE HELP ME OUT!

Yours Faithfully

Nicolás Reggiani
Grupo Todo
Buenos Aires - Argentina

jdMorgan

7:10 am on Dec 1, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nicolas,

Can you describe why you need so many 404 handlers?

A far more friendly approach would be to simply redirect visitors from the old and missing URLs to replacement URLS using a 301-Moved Permanently redirect.

Add a line to .htaccess for each missing file like this:


RedirectPermanent /old_path_to_file http://your_site.com/new_path_to_file

This is described in the Apache mod_alias documentation [httpd.apache.org].

If more files need to be redirected, you might want to investigate mod_rewrite [httpd.apache.org].

I have never tried to declare more than one ErrorDocument 404 per site. Maybe someone who has done so will be of more help.

Jim

KarlDoenitz

11:40 pm on Dec 1, 2002 (gmt 0)

10+ Year Member



THANK YOUUUUUUUUUUUUUUUUUUUUUUUU VERY MUCH! your solution worked PERFECTLY! that was just what i wanted! THANKS AGAIN!

Atte.
Nicolás Reggiani