Skip to content

Instantly share code, notes, and snippets.

@rickbutterfield
Last active January 12, 2018 14:03
Show Gist options
  • Save rickbutterfield/4669024 to your computer and use it in GitHub Desktop.
Save rickbutterfield/4669024 to your computer and use it in GitHub Desktop.
WordPress web.config for running PHP on IIS
<configuration>
<system.webServer>
<!-- URL rewriting so it doesn't have to use index.php -->
<rewrite>
<rules>
<rule name="wordpress" patternSyntax="Wildcard">
<match url="*" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
<!-- CORS - http://enable-cors.org/ -->
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
</customHeaders>
</httpProtocol>
<!-- WordPress upload fix -->
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="100000000" />
</requestFiltering>
</security>
</system.webServer>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment