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"/>
        <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" />


      <action type="Rewrite" url="index.php" />


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

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.

| improve this answer | |
  • 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
  • Re saving my permalinks in this state resulted in the entire site to produce HTTP Error 500.19 - Internal Server Error. Why was that the case? – Malcolm Salvador Mar 16 at 18:15
  • What changes did you make before that? – inarilo Mar 17 at 19:24

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

| improve this answer | |

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.