url rewriting - How to rewrite base path (i.e. "/") with IIS rewrite? -
how rewrite site's base of operations path (i.e. /
) using iis rewrite?
i've tried far:
<rule name="rewriteindexurl" 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="index.html" /> </rule>
currently it's not rewriting base of operations path, , it's returning index.html
directly.
i figure out possible solution , worked:
remove default documents in iis site (i.e. index.html
, index.htm
, default.aspx
...)
add next rewriting rule:
<rule name="rewriteindexurl" stopprocessing="true"> <match url="^" /> <conditions> <add input="{request_filename}" matchtype="isfile" negate="true" /> <add input="{request_filename}" matchtype="isdirectory" negate="false" /> </conditions> <action type="rewrite" url="index.html" /> </rule>
iis url-rewriting iis-8.5
No comments:
Post a Comment