Skip to content

Instantly share code, notes, and snippets.

@rXc3NtR1c
Created May 20, 2014 05:20
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save rXc3NtR1c/ce24e8a3667e50993f1c to your computer and use it in GitHub Desktop.
Save rXc3NtR1c/ce24e8a3667e50993f1c to your computer and use it in GitHub Desktop.
October CMS Web.Config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="themes/.*/(layouts|pages|partials)/.*.htm" />
<action type="Rewrite" url="index.php" />
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="uploads/protected/.*" />
<action type="Rewrite" url="index.php" />
</rule>
<rule name="Imported Rule 3" stopProcessing="true">
<match url="^" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" />
<add input="{URL}" pattern="\.js" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="\.ico" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="\.jpg" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="\.gif" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="\.css" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="\.less" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="\.scss" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="\.png" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="\.swf" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="\.txt" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="\.xml" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="\.xls" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="\.eot" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="\.woff" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="\.ttf" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="\.svg" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="docs/.*" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="themes/.*" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
<rule name="Imported Rule 4" stopProcessing="true">
<match url="^" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
@afugit
Copy link

afugit commented Jun 7, 2017

Worked like a charm, and much cleaner than the IIS URL Rewrite Extension! Thanks much!

@LukeTowers
Copy link

@rXc3NtR1c & @nomad23, please give octobercms/docs@7d2167d a try and let me know how that works.

@charles-tainui
Copy link

Works great, thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment