Search code examples
wordpressiiswebwindows-server-2012iis-8.5

Wordpress on IIS - Please


Environment:

Azure VM Server 2012 R2 IIS v8.5

Scenario:

  • Opened http port on the network interface - Can reach the default IIS page using the VM IP address (http://40.77.29.12/)

  • Installed Wordpress on the VM using Microsoft WPI (Windows Platform Installer) - Can reach the wordpress installation no problem locally on the server

  • Created host A record with domain registrar - Ping domain name (systmerror.com) resolves to the VM IP Address

  • Visiting the domain returns 403 forbidden - http://systmerror.com/

I'm open to any ideas, I've researched and tried many things without success.


Solution

  • Here I put some suggestions to your question:

    1. Make sure that you already configured your hostname to IIS website bindings, so you access the right IIS website.

    2. Next to that you can check that "index.php" is added to Default Document on IIS top level or website level configuration.

    3. Check if the user IUSR has read permissions on the web root folder, you can add this user with write permission on the upload folder to make sure that works.

    4. Don't forget the Rewrite Module in IIS (you need to install this) and make the right configuration in the web.config, example:

      <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="WordPress Rule 1" stopProcessing="true"> <match url="^index\.php$" ignoreCase="false" /> <action type="None" /> </rule> <rule name="WordPress Rule 2" stopProcessing="true"> <match url="^wp-admin$" ignoreCase="false" /> <action type="Redirect" url="wp-admin/" redirectType="Permanent" /> </rule> <rule name="WordPress Rule 3" stopProcessing="true"> <match url="^" ignoreCase="false" /> <conditions logicalGrouping="MatchAny"> <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" /> </conditions> <action type="None" /> </rule> <rule name="WordPress Rule 4" stopProcessing="true"> <match url="^(wp-(content|admin|includes).*)" ignoreCase="false" /> <action type="Rewrite" url="{R:1}" /> </rule> <rule name="WordPress Rule 5" stopProcessing="true"> <match url="^([_0-9a-zA-Z-]+/)?(.*\.php)$" ignoreCase="false" /> <action type="Rewrite" url="{R:2}" /> </rule> <rule name="WordPress Rule 6" stopProcessing="true"> <match url="." ignoreCase="false" /> <action type="Rewrite" url="index.php" /> </rule> </rules> </rewrite> </system.webServer> </configuration>