-
-
Save nurbek-ab/9c2997441fcaa2e52b0a to your computer and use it in GitHub Desktop.
IIS rewrite rule for Symfony 2 (use at root directory)
This file contains 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" encoding="UTF-8"?> | |
<configuration> | |
<system.webServer> | |
<rewrite> | |
<rules> | |
<clear /> | |
<rule name="TempRewriteToWeb" stopProcessing="false"> | |
<match url="^(web/)?(.*)$" /> | |
<action type="Rewrite" url="web/{R:2}" logRewrittenUrl="true" /> | |
</rule> | |
<rule name="StaticFiles" stopProcessing="true"> | |
<match url="^(.*)$" /> | |
<conditions logicalGrouping="MatchAll" trackAllCaptures="false"> | |
<add input="{REQUEST_FILENAME}" matchType="IsFile"/> | |
</conditions> | |
<action type="Rewrite" url="{R:0}" logRewrittenUrl="true" /> | |
</rule> | |
<rule name="RewriteRequestsToPublic" stopProcessing="true"> | |
<match url="^(web/)(.*)$" /> | |
<action type="Rewrite" url="web/app_local.php?{R:2}" logRewrittenUrl="true"/> | |
</rule> | |
</rules> | |
</rewrite> | |
</system.webServer> | |
</configuration> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment