Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Sat, 24 May 2008 14:03:03 -0700,    group: microsoft.public.platformsdk.internet.server.isapi-dev        back       


Getting Original URL before URL is Rewritten   
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 on http://127.0.0.1/global_warming.html
and my ISAPI filter rewrites http://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 14:03:03 -0700   author:   Jeff Dunlap

RE: Getting Original URL before URL is Rewritten   
Just to add some clearification to my post, I want to store the original 
'pretty' URL for later use, not the rewritten URL that is rewritten.

Thank you
date: Sat, 24 May 2008 14:51:01 -0700   author:   Jeff Dunlap

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

Re: Getting Original URL before URL is Rewritten   
David,

Thank you for explaining this and the excellent link to you blog article as 
well.

Best Regards,

Jeff
date: Mon, 26 May 2008 08:27:00 -0700   author:   Jeff Dunlap

Re: Getting Original URL before URL is Rewritten   
FYI
There's a "set HTTP Header" feature in IIRF, the rewriting filter on codeplex.
www.codeplex.com/IIRF.  You can set any header you like.  There is also a 
[U] flag you can apply to rewrite rules to set an HTTP header 
(HTTP_X_SERVERL_URL) to the original, un-rewritten URL. 


"Jeff Dunlap" wrote:

> David,
> 
> Thank you for explaining this and the excellent link to you blog article as 
> well.
> 
> Best Regards,
> 
> Jeff
date: Sat, 14 Jun 2008 18:28:01 -0700   author:   Cheeso

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us