#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    2
    Rep Power
    0
    I'd like to add a feature to my 404 script to get the url that caused the error. I already have the URL of the refering page, but is it possible to determine the incorrect URL that was used to cause the error?

    Thanks in advance,

    Greedo
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 1999
    Location
    Hannover, Germany
    Posts
    17
    Rep Power
    0
    Hi,

    it think it depends on the used server. I can get all the needed information via apache.

    try

    phpinfo();

    the function shows you the servergenerated variables.

    CodeDuck =8

    Hope this helps you.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Location
    Aalborg, Denmark
    Posts
    36
    Rep Power
    15
    If you use Apache as your webserver it's pretty straight forward.

    1) Make sure your 404 page is allowed to execute php-scripts (check your srm.conf file (eg. /etc/httpd/conf/srm.conf) set it to eg. /missing.php3 . Then you make DOCUMENT_ROOT/missing.php3 your 404 page)

    2) The requested url can then be found with the command:
    getenv("REQUEST_URI");

    Hope this helps you a bit

    // Martin
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    2
    Rep Power
    0
    Right now I have the error redirection set using ErrorDocument 404 in the .htaccess file, so the script always thinks the REQUEST_URI is its own path (because you are redirected to it with a new REQUEST_URI). I'll see about trying your solution. Thanks for your help.

    Greedo

Similar Threads

  1. Weird GET requests in log.
    By glog in forum Apache Development
    Replies: 2
    Last Post: January 18th, 2004, 11:53 PM
  2. How to cause a 404 error? (not create custom 404 page!)
    By duwgati in forum PHP Development
    Replies: 22
    Last Post: November 27th, 2003, 04:06 PM
  3. Dyamic site using 404 Handler - Can the 404 HEADER be prevented?
    By Often_Helpful in forum Apache Development
    Replies: 4
    Last Post: September 7th, 2003, 05:10 AM
  4. 404 Handler - Can the 404 HEADER be prevented?
    By Often_Helpful in forum PHP Development
    Replies: 0
    Last Post: September 6th, 2003, 10:16 AM
  5. How can I start mySQL server
    By jyu1 in forum MySQL Help
    Replies: 2
    Last Post: September 5th, 2003, 12:06 PM

IMN logo majestic logo threadwatch logo seochat tools logo