Pretty permalinks are available under
- Apache web server with the mod_rewrite module
- Microsoft IIS 7+ web server with the URL Rewrite 1.1+ module and PHP 5+ running as FastCGI
- Microsoft IIS 6+ using ASAPI_Rewrite
- Lighttpd using a 404 handler or mod_rewrite or mod_magnet
"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.)
Note that for the purposes of this walkthrough it is assumed that WordPress is installed in a Web site root directory. If WordPress is installed in a subdirectory, then the rewrite rules that are used in this walkthrough should be included in the Web.config file located within the same subdirectory where the wordPress files are.
There are three conditions that need to be true in order for WordPress 2.8 to offer pretty permalinks on IIS7:
1. PHP is running via FastCGI
2. PHP version 5 is used
3. URL Rewrite Module 1.1 is installed and enabled.
If any of those is not true then WordPress will work as in previous versions and will offer “Almost Pretty Permalinks” option.
To check if FastCGI is used, call phpinfo() function and check the “Server API”. It should say “CGI/FastCGI”. Alternatively, call php_sapi_name() function. It should return ‘cgi-fcgi’.
- All above procedure are kind of prerequisites to set Pretty Permalinks in Wordpress Blogs. After setting up the wordpress blog, Go to Settings and click on permalinks and you will have a permalink settings window. Now in custom strcuture type /%category%/%postname%/ and click on save changes. see the screen shot given below here.
Create a Rewrite rule and put it in web.config XML file resides in your root folder.
If you haven't any web.config file in your root folder where wordpress is installed, just copy the code given below and paste it in web.config (make new web.config if not available).
<?xml version="1.0"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<remove value="index.php" />
<add value="index.php" />
</files>
</defaultDocument>
<rewrite>
<rules>
<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/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
After changes in web.config just open your home page or post page and chill :) you have done the permalink structure for your wordpress blog.
Read more:
http://codex.wordpress.org/Using_Permalinks
http://learn.iis.net/page.aspx/466/enabling-pretty-permalinks-in-wordpress/
Please let me know if anyone have any kind of doubt. comment below your queries and thanks if you like this article.
