Skip to content

Instantly share code, notes, and snippets.

@stiucsib86
Last active December 24, 2015 06:49
Show Gist options
  • Save stiucsib86/6759304 to your computer and use it in GitHub Desktop.
Save stiucsib86/6759304 to your computer and use it in GitHub Desktop.
Azure Website for PHP web.config file
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<!--
Removing index.php from URLs
-->
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="index.php?url={R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
<handlers>
<!--
The default PHP-CGI handler does not handle the "OPTIONS" verb, so
we will drop the original "PHP54_via_FastCGI" and add it back with
OPTIONS in in the verb list.
-->
<remove name="OPTIONSVerbHandler" />
<remove name="PHP54_via_FastCGI" />
<add name="PHP54_via_FastCGI" path="*.php" verb="GET,HEAD,POST,OPTIONS" modules="FastCgiModule" scriptProcessor="D:\Program Files (x86)\PHP\v5.4\php-cgi.exe" resourceType="Either" />
</handlers>
</system.webServer>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment