Url Rewriting with Querystrings
Posted
by
Alon
on Stack Overflow
See other posts from Stack Overflow
or by Alon
Published on 2011-01-17T13:49:08Z
Indexed on
2011/01/17
13:53 UTC
Read the original article
Hit count: 188
In IIS 7.5, I'm trying to rewrite a Url such as /about
to /content.asp?p=about
, with support for QueryString-s, so if the orginal Url was /about?x=y
, it should rewrite to /content.asp?p=about&x=y
.
The basic rewriting is now working, but when I'm trying to add a QueryString it doesn't work. Tried both /about?x=y
and /about&x=y
.
My current rule:
<rule name="RewriteUserFriendlyURL1" stopProcessing="false">
<match url="^([^/]+)/?$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="content.asp?p={R:1}" />
</rule>
How can I fix this?
Thank you.
© Stack Overflow or respective owner