htaccess and 404 page in php

They have: 7 posts

Joined: Mar 2004

I am using Errordocument in htaccess to set 404 page, problem is
how can I find what page the user wanted to visit.

I checked all server data the script returns me ($_SCRIPT) but could
not find the page. Also I tried document.referrer from javascript but still
no clue.

Is there a way or I need to do some tuning to the htaccess for this?

Thanks in advance ...

Busy's picture

He has: 6,151 posts

Joined: May 2001

try $_SERVER["HTTP_REFERER"]

Greg K's picture

He has: 2,145 posts

Joined: Nov 2003

I wrote a 404 page once that did checking of where people were trying to acess and I just checked that program. In it I used $_SERVER['REQUEST_URI'] for checking what page they tried to access.

For more details and info, see http://www.php.net/manual/en/reserved.variables.php

-Greg

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.