|
|
|
date: Sat, 24 May 2008 14:03:03 -0700,
group: microsoft.public.platformsdk.internet.server.isapi-dev
back
Re: Getting Original URL before URL is Rewritten
IIS does not support the creation or direct modification of Server
Variables. That is a bad idea in general, even if it is the fastest
way to hack up a workaround.
The PHP variable "REQUEST_URI" sounds like a broken concept. What
exactly does "pre-written URL" mean? The original value, the most
recent parent value, or something in between? I can see users wanting
all the possibilities, and it makes no sense to create a new variable
for each.
The right thing to do is for the code that does the remapping to offer
the corresponding unmapping. The ISAPI Filter that rewrites the URL
can certainly modify request headers to indicate the proprietary
meaning of "prior URL" that you want to use, and that value can be
retrieved via Request Server Variables by later applications in the
pipeline, including PHP.
See this blog entry on how it all interacts and works.
http://blogs.msdn.com/david.wang/archive/2006/04/20/HOWTO-Retrieve-Request-Headers-using-ISAPI-ASP-and-ASP-Net.aspx
//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//
On May 24, 2:03 pm, Jeff Dunlap
wrote:
> Dear Forum Members:
>
> I looked at existing server variables, and there is nothing that stores the
> URL before it is rewritten.
>
> Let's say that a user clicks onhttp://127.0.0.1/global_warming.html
> and my ISAPI filter rewriteshttp://127.0.0.1/app.php?article=1525
>
> The IIS server variable SCRIPT_NAME contains /app.php?article=1525
>
> Is there an existing variable that contains /global_warming.html that
> app.php can obtain?
>
> If not, can my custom ISAPI rewrite filter create a variable to store
> global_warming.html?
>
> Under Apache (not IIS unfortunately) there is a PHP variable called
> REQUEST_URI that stores the Pre-written URL. I'm working on someone else's
> PHP application and would like to host it on an IIS server.
>
> Best Regards,
>
> Jeff
date: Sat, 24 May 2008 23:40:14 -0700 (PDT)
author: David Wang
|
|