-
-
Save adilmughal/6388876 to your computer and use it in GitHub Desktop.
Web.config URL rewriting rules for hosting WordPress (PHP) on IIS
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> | |
<rule name="Remove html" stopProcessing="true"> | |
<match url="(.*).html$" /> | |
<conditions> | |
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> | |
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> | |
</conditions> | |
<action type="Redirect" redirectType="Permanent" url="{R:1}" /> | |
</rule> | |
<rule name="Main Rule" stopProcessing="true"> | |
<match url=".*"/> | |
<conditions logicalGrouping="MatchAll"> | |
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/> | |
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/> | |
</conditions> | |
<action type="Rewrite" url="index.php"/> | |
</rule> | |
<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> | |
</system.webServer> | |
</configuration> |
Your a freaking rock star! Thank you!
Thank you it helps. 💃
Thank you very much man!!!
When we are applying this routing rules than not able to create the page or post. Please suggest. I am using 5.4 for the wordpress
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you very much!!!!