Page 1 of 1

get url of not found page

Posted: Fri Jul 24, 2009 2:45 am
by amao
HI all
I need to make customize page to catch any not found page 404.php, I need to url of the page that not found
Ex: my site is http://www.mysite.com/page.php , and the user type http://www.mysite.com/pagg.php
I need to know that the user call pagg.php
I try this code but did not give write result

Code: Select all

 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
 <head>
    <title>404: Page Not Found</title>
    <meta http-equiv="Content-type" content="text/html; charset=ISO-8859-1" />
 </head>
 <body>
 <h1>404: Page Not Found</h1>
 <?php
 echo "the target url is";   
      $requri = $_SERVER['REQUEST_URI'] ;
 echo $requri;
 ?>
 </body>
 </html>
 
but it gives me /404.php

Re: get url of not found page

Posted: Fri Jul 24, 2009 3:12 am
by Mark Baker
Look at the value of $_SERVER['REDIRECT_URL']

Re: get url of not found page

Posted: Fri Jul 24, 2009 3:26 am
by amao
Mark Baker wrote:Look at the value of $_SERVER['REDIRECT_URL']
it give me this error
Notice: Undefined index: REDIRECT_URL in C:\wamp\www\404.php on line 12