-1

Multisite iis server Error 404 not found when I add a comment into subdiectory post.

Page 404 not Found

And this is my web.config file :

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="WordPress Rule 1" stopProcessing="true">
                    <match url="^index\.php$" ignoreCase="false" />
                    <action type="None" />
                </rule>
                <rule name="WordPress Rule 2" stopProcessing="true">
                    <match url="^([_0-9a-zA-Z-]+/)?wp-admin$" ignoreCase="false" />
                    <action type="Redirect" url="{R:1}wp-admin/" redirectType="Permanent" />
                </rule>
                <rule name="WordPress Rule 3" stopProcessing="true">
                    <match url="^" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAny">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" />
                    </conditions>
                    <action type="None" />
                </rule>
                <rule name="WordPress Rule 4" stopProcessing="true">
                    <match url="^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*)" ignoreCase="false" />
                    <action type="Rewrite" url="{R:1}" />
                </rule>
                <rule name="WordPress Rule 5" stopProcessing="true">
                    <match url="^([_0-9a-zA-Z-]+/)?([_0-9a-zA-Z-]+/)?(.*\.php)$" ignoreCase="false" />
                    <action type="Rewrite" url="{R:2}" />
                </rule>
                <rule name="WordPress Rule 6" stopProcessing="true">
                    <match url="." ignoreCase="false" />
                    <action type="Rewrite" url="index.php" />
                </rule> 
            </rules>
        </rewrite>
         <defaultDocument>
            <files>
                <clear />
                <add value="index.php" />
                <add value="Default.htm" />
                <add value="Default.asp" />
                <add value="index.htm" />
                <add value="index.html" />
                <add value="iisstart.htm" />
                <add value="default.aspx" />
            </files>
         </defaultDocument>
    </system.webServer>
</configuration>
3
  • What's your web.config file got for WordPress rules? I found a couple samples after quickly Googling: sample 1; sample 2. Caveat: I don't use IIS for WordPress, so Googling is about as helpful as I can be.
    – Pat J
    Sep 28, 2017 at 15:45
  • This is my web.config content. Sep 28, 2017 at 15:49
  • Rather than post to an external source, please edit your question to add the relevant code. That will make it easier for people to help you out.
    – Pat J
    Sep 28, 2017 at 15:51

1 Answer 1

1

Solved. Just for completeness I add a rule to the web.config file :

<rule name="WordPress Rule 2" stopProcessing="true">
    <match url="^([_0-9a-zA-Z-]+/)?(wp-comments-post.*)" ignoreCase="false" />
    <action type="Rewrite" url="{R:2}" />
</rule>

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.