WordPress – 404 issues with sublinks in Windows

Hello Friends,

I have encountered a lot of issues related to WordPress where the home page loads but when we click on the sub-links or menus, it shows 404 not found. Usually, these kind of issues can be fixed by putting up a default .htaccess file according to the type of WordPress website.  For the WordPress websites running on Linux, we can find the default .htaccess files in the URL given below:
~~~~
https://codex.wordpress.org/htaccess
~~~~

What if the same case is happening in Windows? We all know that .htaccess won’t work in windows and we have web.config files to do the job. What would be the default code for web.config file to fix this Sub-link 404 issue in WordPress? Here we go :
~~~~
<?xml version=”1.0″ encoding=”UTF-8″?>
<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>
~~~~

Just paste the above code in the web.config file and save it. It should solve the problem. I welcome the suggestions and opinions about my posts.

See you guys in my next post. 😉 🙂

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s