apache - Rewrite rules converted to IIS 7.5 -
hi have following rules want import iis url rewrite:
rewritecond %{request_method} rewritecond %{query_string} [a-za-z0-9_]=http:// [or] rewritecond %{query_string} [a-za-z0-9_]=(\.\.//?)+ [or] rewritecond %{query_string} [a-za-z0-9_]=/([a-z0-9_.]//?)+ [nc] rewriterule .* - [f]
however, when using import, error: rule not converted because of conditions using or flag.
any ideas on how in iis?
as mentioned in comment, iis rewrite module can not and
, or
same rule (when group of conditions, either matchany
or matchall
).
here how solve issue:
<rule name="my rule" stopprocessing="true"> <match url=".*" ignorecase="false" /> <conditions logicalgrouping="matchall"> <add input="{request_method}" pattern="get" /> <add input="{query_string}" pattern="[a-za-z0-9_]=(http://)|(\.\.//?)+|(/([a-z0-9_.]//?)+)" /> </conditions> <action type="customresponse" statuscode="403" statusreason="forbidden" statusdescription="forbidden" /> </rule>
it "combines" 3 rules had in 1 using logical |
(or) operator: [a-za-z0-9_]=(http://)|(\.\.//?)+|(/([a-z0-9_.]//?)+)
.
Comments
Post a Comment