Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <rewrite>
- <rules>
- <1--avoid annoying 400 404 error from java bots-->
- <rule name="no-java-bots" stopProcessing="true">
- <match url="(.*)" />
- <conditions>
- <add input="{HTTP_USER_AGENT}" pattern="^Java/.*" ignoreCase="true"/>
- </conditions>
- <action type="AbortRequest" />
- </rule>
- <rule name="Remove www" stopProcessing="false">
- <match url="(.*)" />
- <conditions logicalGrouping="MatchAll">
- <add input="{HTTP_HOST}" pattern="^www\.(.+)$" ignoreCase="true" />
- </conditions>
- <!--redirectType="Permanent" 301 redirect-->
- <action type="Redirect" url="http://{C:1}/{R:0}" appendQueryString="true" redirectType="Permanent" />
- </rule>
- <rule name="HTTP to HTTPS redirect" stopProcessing="true">
- <match url="(.*)" />
- <conditions>
- <add input="{HTTPS}" pattern="off" ignoreCase="true" />
- </conditions>
- <!--redirectType="Found" 302 redirect-->
- <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
- </rule>
- </rules>
- </rewrite>
Advertisement
Add Comment
Please, Sign In to add comment