Question

I have a site that uses Worpress on part of it. I am having trouble with the index page.

With index.php the site loads the most recent posts, which is the desired action with the incorrect url. Without index.php, which is the desired url, the page loads the 404 template.

I have the site working locally correctly. The only thing I can think of, is the web.config is incorrectly routing this request. Since this is an area I don't deal well with, I was hoping to get some help to see if that was the issue.

Here is the web.config contents:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Imported Rule 2-1" stopProcessing="true">
                    <match url="." ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>
Was it helpful?

Solution

It sounds like you don't have index.php in the list of Default Documents. Add index.php to the list as shown below. You can also do this through the IIS settings for Default Document.

    <defaultDocument>
        <files>
            <clear />
            <add value="index.php" />
            <add value="index.asp" />
            <add value="Default.asp" />
            <add value="Default.htm" />
            <add value="index.htm" />
            <add value="index.html" />
            <add value="iisstart.htm" />
            <add value="default.aspx" />
        </files>
    </defaultDocument>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top