Skip to content

Instantly share code, notes, and snippets.

@coliff
Created December 7, 2016 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coliff/4668ccd03d1b37f936f8329a7ff7172f to your computer and use it in GitHub Desktop.
Save coliff/4668ccd03d1b37f936f8329a7ff7172f to your computer and use it in GitHub Desktop.
URL Rewriting web.config for Humhub on Windows Server
<rewrite>
<rules>
<!--# otherwise forward it to index.php-->
<rule name="Imported Rule 1">
<match url="." ignoreCase="false" />
<conditions>
<!--# prevent httpd from serving dotfiles (.htaccess, .svn, .git, etc.) - except let's encrypt challenge-->
<!--# RewriteBase is required in some hosting environments (Amazon EC2, ...)-->
<!--#RewriteBase /-->
<!--# if a directory or a file exists, use it directly-->
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<!--# prevent application 404 errors-->
<add input="{REQUEST_FILENAME}" pattern="robots\.txt" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" pattern="favicon\.ico" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment