Wordpress permalinks error 404 on IIS

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?

Topic permalinks Wordpress

Category Web


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


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.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.