Ezilon.com - Target Your Audience, be Seen in Your Region

htaccess and 404 page in php

You are viewing this site as a guest. Join our community to get your questions answered and share knowledge. Active members may advertise and ask for a website critique.

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
Modrater

He has: 6,148 posts

Joined: May 2001

try $_SERVER["HTTP_REFERER"]

Greg K's picture
Moderator

He has: 1,601 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

[This space intentionally left blank]

Cool Geek Supplies: www.ThinkGeek.com