php - What is the best way to get the URL of a 404'd file after redirect? -
I am working with a PHP site for which errors must be logged in a database. As such, I have set up an .htaccess file as follows:
ErrorDocument 404 / 404.php
All logging functions required to log in to 404.php include Database.
Here went the content of $ _SERVER Suprglobl array:
[HTTP_HOST] => {left} [HTTP_USER_AGENT] => Mozilla / 5.0 (Windows; U; Windows NT 5.1, en-US; RV .: 1.9.1.7) Lizard / 20,091,221 Firefox / 3.5.7 [HTTP_ACCEPT] => text / html, application / xhtml + xml, application / xml; Q = 0.9, * / *; q = 0.8 [HTTP_ACCEPT_LANGUAGE] => en-us, en; q = 0.5 [HTTP_ACCEPT_ENCODING] => gzip, remove air [HTTP_ACCEPT_CHARSET] => ISO-8859-1, utf-8; Q = 0.7, *; q = 0.7 [HTTP_KEEP_ALIVE] => 300 [HTTP_CONNECTION] => keep-alive [path] => / usr / local / bin: / usr / bin: / bin [SERVER_SIGNATURE] => [SERVER_SOFTWARE] => Apache / 2.2. 8 (Ubuntu) omitted [SERVER_NAME] => {} [SERVER_ADDR] => {left} [SERVER_PORT] => 80 [REMOTE_ADDR] => {left} [DOCUMENT_ROOT] => the} [SERVER_ADMIN] leaving {= > [no address] [SCRIPT_FILENAME] => /404.php [REMOTE_PORT] => 19,274 [GATEWAY_INTERFACE] => CGI / 1.1 [SERVER_PROTOCOL] => HTTP / 1.1 [REQUEST_METHOD] => get [QUERY_STRING] => [REQUEST_URI ] => /404.php [SCRIPT_NAME] => /404.php [PHP_SELF] => /404.php [REQUEST_TIME] => {omitted}
Any suggestions?
REQUEST_URI means the requested URL path and Include the query.
Comments
Post a Comment