Mod_rewrite question - does php expose the original url?

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

    Mod_rewrite question - does php expose the original url?

    Hi All,

    Forgive a newbie-ish question here, but I've not been long in the Apache /
    PHP world.

    I'm just learning about mod_rewrite, and a question occurred to me. Once
    Apache has rewritten a url, the php page can (obviously) see the *rewritten*
    url and access it via $_GET. But does php have any access to the *original*
    url? I'm told that Apache *does* expose both urls (original and rewritten),
    it's just a question of whether the php module also exposes both.

    Any ideas?

    Cheers,

    JON


  • Justin Koivisto

    #2
    Re: Mod_rewrite question - does php expose the original url?

    Jon Maz wrote:
    [color=blue]
    > Hi All,
    >
    > Forgive a newbie-ish question here, but I've not been long in the Apache /
    > PHP world.
    >
    > I'm just learning about mod_rewrite, and a question occurred to me. Once
    > Apache has rewritten a url, the php page can (obviously) see the *rewritten*
    > url and access it via $_GET. But does php have any access to the *original*
    > url? I'm told that Apache *does* expose both urls (original and rewritten),
    > it's just a question of whether the php module also exposes both.
    >
    > Any ideas?[/color]

    PHP can access the requested URI (seen in the browser's address bar) is
    in $_SERVER['REQUEST_URI']. AFAIK, there isn't a direct entry of the
    target URI (or query string) set in the $_SERVER array...

    --
    Justin Koivisto, ZCE - justin@koivi.co m

    Comment

    • Jon Maz

      #3
      Re: Mod_rewrite question - does php expose the original url?

      Thanks a lot Justin!

      JON


      Comment

      Working...