Enable Fancy Permalinks in WordPress on IIS

WordPress_LogoInfo

The majority of self-hosted WordPress installations use Apache as opposed to IIS. Therefore, when it came time to change the permalinks for NervousAdmin.com it was a little trickier. That combined with the lack of documentation turned a rather simple process into a few hours of troubleshooting. The guide below is intended to streamline this process for anyone in the future.

Steps

  • Ensure that URL Re-Write is installed in IIS
    • This can be checked via the IIS Administration console, there should be an icon for URL Re-Write as seen here.
  • Browse to the root directory where WordPress is installed
    • This folder should contain files such as wp-config.php and wp-settings.php
  • Create/edit the web.config file
    • If creating the web.config file ensure it is created with UTF-8 encoding. Notepa++ is great for easily identifying the encoding for a text file.

  • Add the following code:

<?xml version=”1.0″ encoding=”utf-8″?>
<configuration>
<system.webServer>
<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>
</system.webServer>
</configuration>

  • Save the file.
  • Login to the WordPress Admin
  • Browse to Settings -> Permalinks
  • Select the desired permalink format
  • Click Ok
    • WordPress will take care of any re-directs so making this change will not break any URLs.
  • Viola!

Help! My Images are Broken Now!

  •  With some themes the images may now be broken. Don’t worry, this is simply a permissions issue.
  • The first step is to determine the PHP Upload temp directory
    • By default this is C:\Windows\Temp
    • If this directory has been changed it will be defined in php.ini under upload_tmp_dir
  • To fix the images problem the permissions will need to be adjusted on the PHP Upload temp directory
  • Give the IIS_USERS group account both List and Read permissions on the directory
  • IIS_USRS_Permissions

 

 

 

 

 

 

 

 

 

 

 

  • Lastly, browse to the wp-content folder for the WordPress installation.
  • Right-click the upload folder and select Properties
  • Click the Security and verify the IUSR account has Full Control on the folder
    • If the IUSR account has these permissions then try removing the permissions and re-adding them to get them to re-propagate to the folders below.
  • The images on the WordPress site should now load properly.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.