PDA

View Full Version : IIS7 URL Rewriting Problem



Jim
31 May 2010, 07:12 PM
I am trying to rewrite URLs on an IIS7 server (yes, the URL rewrite module is installed) and it works fine for simple rules, but I need it to work with a map. This is the code copied straight from the IIS website that I would have thought should work, but does not:


<configuration>
<system.webServer>
<rewrite>
<rewriteMaps>
<rewriteMap name="StaticRewrites" defaultValue="">
<add key="/randomtest1" value="/rewritten/index.phpi=1" />
<add key="/randomtest2" value="/rewritten/index.php?i=2" />
</rewriteMap>
</rewriteMaps>
<rules>
<rule name="Rewrite Rule">
<match url=".*" />
<conditions>
<add input="{StaticRewrites:{REQUEST_URI}}" pattern="(.+)" />
</conditions>
<action type="Rewrite" url="{C:1}" appendQueryString="False" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

Sorry if the XML above formats strangely...

Anyone got any ideas on what might be wrong? Thanks!

mileka
08 Jun 2010, 05:38 PM
I wish i could help but i switched over to Apache after basically...well ditching almost everything microsoft. I too had a similar problem, check this website out there are devs on there that im sure could help. That's where i got almost all my help when i was running an IIS server.

http://forums.iis.net/