Forums

web.config - all works, except site root (5 posts)

  1. Platinummember
    Member
    Posted 1 year ago #

    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

  2. arkgroup
    Member
    Posted 1 year ago #

    Platinummember,

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

  3. Platinummember
    Member
    Posted 1 year ago #

    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?

  4. Platinummember
    Member
    Posted 1 year ago #

    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

  5. Platinummember
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic