Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've recently switched from linux to windows hosting on IIS7. I have permalinks working fine, but for some reason when I try to view the site index (index.php) I get an internal wordpress 404. I can only assume this has something to do with the migration but am baffled as to the cause. My web.config contains this:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <httpErrors errorMode="Detailed" />
        <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>

The site in question is http://www.lime49.com/ . Is there something in Wordpress which could cause this?

share|improve this question
    
The problem seems to be that somehow Index.php (with capital i) is requested instead of index.php - though i can't really tell you what's causing this.. –  ptriek Dec 4 '11 at 16:10
    
This is a long shot, but might be worth it - go to your WP dashboard, and check your Reading settings. If you have assigned a page for home, and another one for blog - and if you are using a custom template for the "home" page, then you should try re-assigning the custom template to the home, and re-publish that page. It worked for me once. This happened to me when working on my custom templates, and, for some reason, the "home" page was not recognized as such anymore, and returned a 404. –  cr0z3r Dec 4 '11 at 16:17
    
Thanks. I desparately wanted this to work but no luck. –  Echilon Dec 4 '11 at 17:44
    
try adding this to your .htaccess file: RewriteRule ^(.*[A-Z].*)$ $1 [CL,R=301,L] (for rewriting capital I to i) –  ptriek Dec 4 '11 at 18:02
    
the problem seems that you've switched from linux to windows hosting on IIS7... I would have been glad to help you, and you would have been a lot more answers with a LAMP solution ;) –  Olivier Pons Dec 4 '11 at 21:04

2 Answers 2

up vote 0 down vote accepted

The problem is IIS rewriting. You actually need to do two things to make this work if using custom permalinks on IIS.

In Settings-Permalinks select Custom Structure and enter /%postname%/. In your web.config, use this as your rewrite section:

<rewrite>
    <rules>
        <rule name="wordpress">
            <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>
        <rule name="wordpress2">
            <match url="(?!index\.php|wp-|xmlrpc)(.*)" />
                <conditions>
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                </conditions>
            <action type="Rewrite" url="index.php/{R:0}" />
        </rule>
    </rules>
</rewrite>
share|improve this answer

Do you have the SRG Clean Archives Plugin active on the site? If so, try disabling it.

share|improve this answer
    
I did, but disabling it and all other plugins does not have any effect. –  Echilon Dec 4 '11 at 21:48
    
Sorry, thought that may had been causing a confliction, since it only seemed to appear on the home page. Although, going directly here works: lime49.com/index.php –  James Dec 5 '11 at 3:09
    
That's what I find odd. Surely it can't be a web.config/htaccess rewrite problem if /index.php works. It's as though WP is detecting that no path was requested and adding /Index.php as a last resort. –  Echilon Dec 5 '11 at 11:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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