Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <configuration>
- <system.webServer>
- <!-- Prevent web access to all files in the /config/ directory -->
- <security>
- <requestFiltering>
- <hiddenSegments>
- <add segment="config"/>
- </hiddenSegments>
- </requestFiltering>
- </security>
- <!-- Add mime types for a few additional files -->
- <staticContent>
- <mimeMap fileExtension=".json" mimeType="application/json" />
- <mimeMap fileExtension=".mp4" mimeType="video/mp4 " />
- </staticContent>
- <!-- X3 rewrite rules -->
- <rewrite>
- <rules>
- <!-- Prevent access to various PHP with exceptions -->
- <rule name="Prevent access to various PHP with exceptions">
- <match url="^(app|templates|extensions)/" />
- <conditions>
- <add input="{REQUEST_FILENAME}" pattern="\.php$" ignoreCase="false" />
- <add input="{REQUEST_FILENAME}" pattern="(/app/parsers/slir/|x3.mailer.php|x3.api.php)" ignoreCase="false" negate="true" />
- </conditions>
- <action type="CustomResponse" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
- </rule>
- <!-- Rewrite any calls to *.html, *.json, *.xml, *.atom or *.rss if a folder matching * exists -->
- <rule name="Rewrite any calls to *.html, *.json, *.xml, *.atom or *.rss if a folder matching * exists" stopProcessing="false">
- <match url="(.+)\.(html|json|xml|atom|rss)$" ignoreCase="false" />
- <conditions logicalGrouping="MatchAll">
- <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
- <add input="{URL}" pattern="public/" ignoreCase="false" negate="true" />
- <add input="{DOCUMENT_ROOT}/public/{R:1}.{R:2}" matchType="IsFile" negate="true" />
- </conditions>
- <action type="Rewrite" url="{R:1}/" />
- </rule>
- <!-- Add a trailing slash to directories -->
- <rule name="Add a trailing slash to directories" stopProcessing="false">
- <match url="([^/]+)$" ignoreCase="false" />
- <conditions logicalGrouping="MatchAll">
- <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
- <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
- <add input="{URL}" pattern="(\.|\?)" ignoreCase="false" negate="true" />
- <add input="{URL}" pattern="(.*)/$" ignoreCase="false" negate="true" />
- </conditions>
- <action type="Rewrite" url="{R:1}/" />
- </rule>
- <!-- Rewrite any calls to /render to the image parser -->
- <rule name="Rewrite any calls to /render to the image parser" stopProcessing="false">
- <match url="^render/." ignoreCase="false" />
- <conditions logicalGrouping="MatchAll">
- <add input="{URL}" pattern="render/" ignoreCase="false" />
- </conditions>
- <action type="Rewrite" url="app/parsers/slir/" />
- </rule>
- <!-- Rewrite routes to index.php if they are non-existent files/dirs -->
- <rule name="Rewrite routes to index.php if they are non-existent files/dirs" stopProcessing="false">
- <match url="^(.*)/$" ignoreCase="false" />
- <conditions logicalGrouping="MatchAll">
- <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?/{R:1}/" appendQueryString="true" />
- </rule>
- <!-- Rewrite any file calls to the public directory -->
- <rule name="Rewrite any file calls to the public directory" stopProcessing="false">
- <match url="^(.+)$" ignoreCase="false" />
- <conditions logicalGrouping="MatchAll">
- <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
- <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
- <add input="{URL}" pattern="public/" ignoreCase="false" negate="true" />
- </conditions>
- <action type="Rewrite" url="public/{R:1}" />
- </rule>
- </rules>
- </rewrite>
- </system.webServer>
- </configuration>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement