[IIRF / IIS] how to read the request URI

Topics: User Forum
Dec 6, 2006 at 2:16 PM
I use the following RewriteRules to forward most requests on my domain to index.php:
RewriteRule /img/(.*) /img/$1 L
RewriteRule /css/(.*) /css/$1 L
RewriteRule /jsf/(.*) /jsf/$1 L
RewriteRule /php/verwerk/(.*) /php/verwerk/$1 L
RewriteRule ^(.*)$ /index.php

This works properly. But now i want to use/read the requested URL in my index.php. I tried to find the correct $SERVER var, but i think i found some bug in IIRF. Because when i print the $SERVER array, the following keys remain empty:


while they should contain the requested URI.

Anyone knows why this happens or what to do against this? Thanks in advance.
Dec 6, 2006 at 3:39 PM
As long as I've understood what you mean:
Where you have L at the end of your rules, change this to U,L. For the last rule where you don't have L, you'll need to use U. This tells IIRF to unmangle the URL. You should then be able to use $_SERVER'HTTP_X_REWRITE_URL'

Hope this helps!
Dec 11, 2006 at 2:24 PM
Thnx. This is the code that works for me:

IterationLimit 1
RewriteRule ^(.)\?(.)$ /index.php?URI=$1&$2 U