getting 404 link

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • john

    #1

    getting 404 link

    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_REFER ER"]),
    - the exact link that provoqued a 404 error.

    How can I get the 2 piece of info ?

    Many thanks in advance,

    --
    john


  • Ben Gribaudo

    #2
    Re: getting 404 link

    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" <john@nospam.or g> wrote in message
    news:40d6f1a7$0 $3975$626a14ce@ news.free.fr...[color=blue]
    > Hi all,
    >
    > Thanks to my apache .htaccess file, all the 404 errors are redirected to[/color]
    my[color=blue]
    > 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_REFER ER"]),
    > - the exact link that provoqued a 404 error.
    >
    > How can I get the 2 piece of info ?[/color]
    [snip]


    Comment

    • john

      #3
      Re: getting 404 link

      "Ben Gribaudo" <bengribaudoN_O _@_S_P_A_Mveriz on.net> a écrit dans le message
      news: zeDBc.16188$a61 .4944@nwrddc01. gnilink.net...[color=blue]
      > 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[/color]

      thanks very much !

      --
      john


      Comment

      Working...