WordPress.org

Ready to get started?Download WordPress

Forums

Pretty serious bug: 404 error because of server setting. (3 posts)

  1. tjoekbezoer
    Member
    Posted 9 years ago #

    I found a bug that creates a 404 page not found error when you try to visit your wordpress site. This is caused by a server which has the default document (index.php) starting with a capital, like mine.

    This means that a 404 error occurs when the default page set on the server is 'Index.php' instead of 'index.php'.

    I found this line of code in wp-blog-header.php:
    20: (false === strpos( $_SERVER['PATH_INFO'] , 'index.php'))

    I was able to fix the problem easily by changing the line as follows:
    20: (false === strpos( strtolower( $_SERVER['PATH_INFO'] ), 'index.php'))

    Now wordpress can also handle server which have their default document setting starting with a capital :)

    Hope this helps

    greetings,

    TjoekBezoer

  2. Tahongawaka
    Member
    Posted 9 years ago #

    Does WordPress have the bug because it doesn't match your site, or does you site have a bug because it doesn't conform to the standards?

    Or, should you make sure that you have a DirectoryIndex listing in your .htaccess file that adds your non-standard page?

  3. tjoekbezoer
    Member
    Posted 9 years ago #

    I think it's wordpress. First of all, I use IIS and not Apache, so .htaccess files do not really apply. Secondly, adding 'default.php' to IIS's default document setting is a job that has to be done manually, which means you can type it with a capital as well with a normal character.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.