PDA

View Full Version : 404 get URL of page



NANO3
June 9th, 2005, 10:43 PM
how do i get the URL of the page that the person tried to access on the 404?

such as

http://google.com/niraj

look at that page and notice the url

the url is still google.com/niraj

and the page says

/niraj could not be found..

Ankou
June 9th, 2005, 10:57 PM
Depends on what you're using. In PHP I believe you can use $REQUEST_URI.

Otherwise... http://www.alistapart.com/articles/perfect404/ may help. It's in JavaScript - not my first choice to do something like this, but if you're limited on language options it's a place to start.

NANO3
June 16th, 2005, 07:49 PM
ok thanks

i can use php, i'll ask uber it seems to be like that on his site

andr.in
June 17th, 2005, 09:03 AM
$_SERVER['SCRIPT_NAME'] works