By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,278 Members | 1,359 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,278 IT Pros & Developers. It's quick & easy.

getting 404 link

P: n/a
Hi all,

Thanks to my apache .htaccess file, all the 404 errors are redirected to my
404.php file.

I'd like to get the following infos :
- the page address from which the 404 error come from (I get it with
$_SERVER["HTTP_REFERER"]),
- the exact link that provoqued a 404 error.

How can I get the 2 piece of info ?

Many thanks in advance,

--
john
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi John,

URL of the page that wasn't found:
$_SERVER['REDIRECT_URL']

Query string submitted to the page that wasn't found:
$_SERVER['REDIRECT_QUERY_STRING']

URL that referred the visitor to the page that wasn't found:
$_SERVER['HTTP_REFERER']

Have a great day!

Ben :-)
Ben Gribaudo - Baltimore, MD - www.bengribaudo.com

"For God so loved the world, that he gave his only begotten Son, that
whosoever believeth in him should not perish, but have everlasting life."
John 3:16
"john" <jo**@nospam.org> wrote in message
news:40**********************@news.free.fr...
Hi all,

Thanks to my apache .htaccess file, all the 404 errors are redirected to my 404.php file.

I'd like to get the following infos :
- the page address from which the 404 error come from (I get it with
$_SERVER["HTTP_REFERER"]),
- the exact link that provoqued a 404 error.

How can I get the 2 piece of info ?

[snip]
Jul 17 '05 #2

P: n/a
"Ben Gribaudo" <bengribaudoN_O_@_S_P_A_Mverizon.net> a écrit dans le message
news: ze******************@nwrddc01.gnilink.net...
Hi John,

URL of the page that wasn't found:
$_SERVER['REDIRECT_URL']

Query string submitted to the page that wasn't found:
$_SERVER['REDIRECT_QUERY_STRING']

URL that referred the visitor to the page that wasn't found:
$_SERVER['HTTP_REFERER']

Have a great day!

Ben :-)
Ben Gribaudo - Baltimore, MD - www.bengribaudo.com

"For God so loved the world, that he gave his only begotten Son, that
whosoever believeth in him should not perish, but have everlasting life."
John 3:16


thanks very much !

--
john
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.