asp.net - IIS Url rewrite username -
how can rewrite url in iis
mysite.com/profile.aspx?user=foo
to
mysite.com/foo
this rewrite condition i've tried in .htaccess
rewriterule /foo/(.*) /bar?arg=p1\%3d$1 [r,ne]
but how can in iis url rewrite?
quite simply:
<rule name="profile rewrite" stopprocessing="true"> <match url="^([^/]+)/?$" /> <conditions> <add input="{request_filename}" matchtype="isfile" negate="true" /> <add input="{request_filename}" matchtype="isdirectory" negate="true" /> </conditions> <action type="rewrite" url="profile.aspx?user={r:1}" /> </rule>
note apache rewrite rule won't expect @ all. note can generate url rewrite visual configure tool within iis manager.
Comments
Post a Comment