• First of all, I don’t speak web.config. So I have to rely on the examples I find on the internet and just try. This seems to be the standard web.config to use:

    <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>

    I have several WP sites on the same dedicated server and all sites work with this web.config, except one. When you go to http://www.mysite.com , you see a 404 [1]. All other links work, including http://www.mysite.com/index.php. It’s driving me mad because I can’t see the difference with the other sites on the same server.

    [1] custom 404

Viewing 4 replies - 1 through 4 (of 4 total)
  • Platinummember,

    Try to restart web service for this domain, then clear your browser cache and access your website again.

    Thread Starter Platinummember

    (@platinummember)

    Tried it, doesn’t work.

    I discovered one difference which I overlooked: the working site has WP 3.0.1 and the sites where it doesn’t work have version 3.1. Would it be a bug in 3.1?

    Thread Starter Platinummember

    (@platinummember)

    Hmm, I downgraded to 3.0.3 in my own language (Dutch) but it has the same problem. Chance that the version is the problem is slim, I think.

    I’m pulling my hair out over this. Especially while I have a site on the same server that does work :-S

    Thread Starter Platinummember

    (@platinummember)

    Still can’t get it to work. So I made a dirty solution: redirect the root to index.php. I added this in index.php as first two instructions:

    $file = $_SERVER[“SCRIPT_NAME”];
    if ($file != “/index.php”) header(‘Location: index.php’);

    It’s ugly but it works.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘web.config – all works, except site root’ is closed to new replies.