404 get URL of page

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…