Permalinks without mod_rewrite for WordPress

September 20, 2022Read time:4 min read

“Pretty” permalinks usually require mod_rewrite, and IIS (common on Windows servers) does not support mod_rewrite. (If you are using Apache 2.0.54, on Windows, mod_rewrite may work, provided it is enabled in apache\conf\httpd.conf.)

If you are using IIS 7 and have admin rights on your server, you can use Microsoft’s URL Rewrite Module instead. Though not completely compatible with mod_rewrite, it does support WordPress’s pretty permalinks. Once installed, open the web.configfile in the WordPress folder and add the following rule to the system.webServer element

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="WordPress Rule" stopProcessing="true">
<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?page_id={R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

There’s a full installation guide on the IIS site. The module is available for x64 and x86 systems.

If this isn’t an option, you can try PATHINFO permalinks; put index.php/ at the start of your custom permalink structure:

 /index.php/%year%/%monthnum%/%day%/%postname%/

This option may not always work, especially in cases of WordPress running on IIS 6. To make this option work on IIS, add these 2 lines to a php.ini file and store that file in your webroot :

 cgi.fix_pathinfo = 1
 cgi.force_redirect = 0

Another solution exists using IIS’ custom 404 redirects. It requires that your web host allows you to add a custom 404 redirect, but it doesn’t require you to install any 3rd party mod_rewrite software and it also doesn’t require that your permalink structure begin with/index.php/.


Need Support?

Can't find the answer you're looking for? Don't worry we're here to help!
Contact Support