0

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"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="WordPress Rule" stopProcessing="true">
<match url=".*" />
<conditions>
<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>

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 Jan 1 '16 at 6:47
  • In PHP info it is showing me Microsoft-IIS/8.0 , is that correct version? – Helping Hands Jan 1 '16 at 6:55
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! – PoloHoleSet Apr 13 '18 at 17:19

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.