Search code examples
wordpresspermalinks

index.php shown up in every link


my problem is that my link shows (index.php) in every link like this

(www.mysite.com/index.php/postname)

and i want to show it like this

 (www.mysite.com/postname)

but i want to remove that (index.php) from my links so how to do that?

i m using (iis) 7.5 and (wordpress) 4.01

i try so many things but did not work so how to solve it?

and i cant also see web.config but i can see (wp.config) so are they same?


Solution

  • You need to log into wordpress admin and go to permalinks and change

    Custom Structure to: /%postname%/

    Do not add the domain or index.php

    if your'e running IIS you need to follow instructions on this link:

    http://codex.wordpress.org/Using_Permalinks#Permalinks_without_mod_rewrite
    

    or you can just add web.config file to the root folder (where the WP install is) containing

    <?xml version="1.0"?>
    <configuration>
       <system.webServer>
          <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" />
                </rule>
             </rules>
          </rewrite>
       </system.webServer>
    </configuration>
    

    Then you can adjust your permalinks to your custom setup in the admin panel.