0

i have enable permalinks on my wordpress site and now every page returns 404 error. The site is hosted in IIS 8.5

the web.config file has the following rule inside

<?xml version="1.0" encoding="UTF-8"?>

<directoryBrowse enabled="false"/>
<rewrite>
  <rules>
  <clear/>
        <rule name="wordpress" 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>

what can i do to fix that and make permalinks work?

  • Go to settings > permalinks and save the changes again. If your .htaccess is not writable, copy the codes mentioned at the bottom of the page to your .htaccess file. Make sure mod_rewrite is enabled on your server. – Annapurna Sep 19 '17 at 6:26
0

For permalinks to work, you need to resave the permalinks in the permalinks admin section of WP. The same applies when you change the url structure, even if permalinks were already in use.

  • You should write this as a comment, a answer. – I am the Most Stupid Person Sep 18 '17 at 11:08
  • i considered that but this is an answer to the question. if you want to suggest improvements, i'd be happy to know them. – inarilo Sep 18 '17 at 14:09
0

You need to put this code <?php flush_rewrite_rules( True ); ?> inside your functions.php file to flush the rewrite rules.

Reference codex.wordpress.org

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.