Development PHP referer troubles

Discussion in 'Software' started by relix, 11 May 2004.

  1. relix

    relix Minimodder

    Joined:
    14 Nov 2001
    Posts:
    5,948
    Likes Received:
    41
    I'm trying to make a custom 404 page for my site that checks for similar pages of which the user typed a missing page. So for example, I want the user to be redirected to keyboards.php if he typed keyboard.php or just keyboard.

    Now, the trouble is, I can't seem to get the URI the user typed, that didn't exist. I tried several ways that people adviced to me, but none worked. This is the source-code:

    PHP:
    Request_uri: <? echo $_SERVER['REQUEST_URI'] ?><br>
    Http_referer: <? echo $_SERVER['HTTP_REFERER'] ?><br>
    Redirect_url: <? echo $_ENV['REDIRECT_URL'] ?>
    This is the 404-page: http://www.thefreakybelgian.net/404.php
    This is a link to a page that doesn't exist: http://www.thefreakybelgian.net/idonotexist.php

    As you can see, $_SERVER['REQUEST_URI'] displays the 404-page itself, the referer is the referer before the missing page has been clicked, and the redirect_url is empty.

    Any hardcore php'ers know what's wrong? What can I do to fix it? Thanks :)
     
  2. relix

    relix Minimodder

    Joined:
    14 Nov 2001
    Posts:
    5,948
    Likes Received:
    41
    No one knows?

    The 404 doesn't work at all anymore, but I just tried putting phpinfo() inside the 404, and no variable whatsoever had the not-existing url in. How can I "activate" it? There must be some way! :(
     
  3. exile

    exile What's a Dremel?

    Joined:
    8 Mar 2004
    Posts:
    46
    Likes Received:
    0
    I can first point out you have Request_uri << maby it should be Request_url

    You have an i where you need L. :idea: that the prob?
     
  4. relix

    relix Minimodder

    Joined:
    14 Nov 2001
    Posts:
    5,948
    Likes Received:
    41
    nope, that's not the problem :s
     

Share This Page