Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

LukeTowers commented Jul 24, 2018

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

@charles-tainui
Copy link

charles-tainui commented May 24, 2019

Works great, thanks !

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