In My wordpress site When I set Permalink structure as Post Name , It redirects all posts to 404. With Default permalink , It works fine.

Server Details :

Windows Server - IIS

Web.Config Code :

<?xml version="1.0" encoding="UTF-8"?>
<rule name="WordPress Rule" stopProcessing="true">
<match url=".*" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<action type="Rewrite" url="index.php" />

I have just got help from here : https://codex.wordpress.org/Using_Permalinks

But that code is not working for me. Should I need to modify any other file as well to solve 404 error?

  • Hi, What is your IIS version.
    – Vee
    Commented Jan 1, 2016 at 6:47
  • In PHP info it is showing me Microsoft-IIS/8.0 , is that correct version? Commented Jan 1, 2016 at 6:55

1 Answer 1


I believe the issue you are having is that the URL you have in your match tag, <match url=".*" /> needs to be url="*". Notice the absence of the dot. Currently your rule is only matching on URLs that end with an extension, like index.php, blog.html, background.jpg, etc. Removing the dot should allow it to match all URLs.

  • I've notice a ton of example versions with each of those options, and have been trying to figure out the difference. Thank you! Commented Apr 13, 2018 at 17:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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