1Use this web.config
2
3(web.config is the IIS equivalent to .htaccess file in apache webservers. It can be found in the root folder. If there is none, you need to create one.)
4
5
6<?xml version="1.0" encoding="UTF-8"?>
7<configuration>
8<system.webServer>
9 <defaultDocument>
10 <!-- Set the default document -->
11 <files>
12 <remove value="index.php" />
13 <add value="index.php" />
14 </files>
15 </defaultDocument>
16 <httpErrors errorMode="Detailed"/>
17 <rewrite>
18 <rules>
19 <rule name="wordpress" patternSyntax="Wildcard">
20 <match url="*" />
21 <conditions>
22 <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
23 <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
24 </conditions>
25 <action type="Rewrite" url="index.php" />
26 </rule>
27 </rules>
28 </rewrite>
29</system.webServer>
30</configuration>
31
32
33Then in permalinks page, set "Custom Structure" and give the value /%postname%/
34
35Note that URL Rewrite module specific to IIS version needs to be installed for this to function(Thanks to @Spikolynn's comment below)