PDA

View Full Version : ErrorDocument 404 directive acting up...


LeeCHeSSS
Wed 15th Jan '03, 3:24pm
Ok, short explanation of my problem:

I'm trying to use ErrorDocument to get people automatically redirected to my site when they visit a non-existant location on the server.

I'm trying to do this with:<Directory /home/danny>
ErrorDocument 404 /home/danny/sites/www.online-roleplaying.com/index.php
</Directory>

My site used to be reachable through 2 urls: www.online-roleplaying.com (http://www.online-roleplaying.com) and www.forasake.com/~danny (http://www.forasake.com/~danny)

On both urls it doesn't work and here's why: it respectively tries to redirect to home/danny/sites/www.online-roleplaying.com/home/danny/sites/www.online-roleplaying.com/index.php and /var/www/html/home/danny/sites/www.online-roleplaying.com/index.php

I've tried loads of things to make it use the path given with ErrorDocument starting from the toplevel directory, but alas...

Anyone know how to fix this?

LanciaStratos
Wed 15th Jan '03, 6:15pm
My .htaccess file simply contains the below code, and it works fine for me. I really don't think you are supposed to include the whole path, just the domain name as you would type it into your browser.

ErrorDocument 404 http://www.gtplanet.net/

LeeCHeSSS
Thu 16th Jan '03, 2:56am
Originally posted by LanciaStratos
My .htaccess file simply contains the below code, and it works fine for me. I really don't think you are supposed to include the whole path, just the domain name as you would type it into your browser.

ErrorDocument 404 http://www.gtplanet.net/ Ehm, using a full url will not send along the HTTP_REFERRER and similar variables, so YES you are supposed to use paths.

LanciaStratos
Thu 16th Jan '03, 12:49pm
Originally posted by LeeCHeSSS
Ehm, using a full url will not send along the HTTP_REFERRER and similar variables, so YES you are supposed to use paths. Why is that important?

LeeCHeSSS
Thu 16th Jan '03, 1:05pm
Because I want to use the variables, but never mind; obviously noone here knows...