Last active
December 18, 2015 09:59
-
-
Save breyed/5765457 to your computer and use it in GitHub Desktop.
web.config for question2answer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<configuration> | |
<system.webServer> | |
<rewrite> | |
<rules> | |
<rule name="DeduplicateSlashes" stopProcessing="true"> | |
<match url="." ignoreCase="false" /> | |
<conditions> | |
<add input="{URL}" pattern="^(.*)//(.*)$" ignoreCase="false" /> | |
</conditions> | |
<action type="Redirect" redirectType="Permanent" url="{C:1}/{C:2}" /> | |
</rule> | |
<rule name="CleanRouting" stopProcessing="true"> | |
<match url="^.*$" ignoreCase="false" /> | |
<conditions> | |
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /> | |
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" /> | |
</conditions> | |
<action type="Rewrite" url="index.php?qa-rewrite={R:0}&{QUERY_STRING}" appendQueryString="false" /> | |
</rule> | |
</rules> | |
</rewrite> | |
<!-- Double escaping is needed for URLs with '+', e.g. for the account page for a username with a space. --> | |
<security> | |
<requestFiltering allowDoubleEscaping="true" /> | |
</security> | |
</system.webServer> | |
</configuration> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment