Pages

Wednesday, May 14, 2014

How to solve the permalinks issue of /index.php/%postname% but not with just %postname% in IIS?

When we deploy the wordpress in ISS servers or Amazon windows servers .htaccess won't work untill we install httpd.conf and enable the htaccess there. Because of this we will get the issue of url with index.php/%postname% .

To solve this issue go to web.config file in IIS add below code in between of <rewrite><.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>