Last night, I getting lots of 404 error while using Google to search my own blog index page, I realized there is something wrong about my blog.

My user-created-outside-of-WP folder is throwing a 404 when trying to access it. Now for some details:

Blog www.moon-blog.com : normal WP blog. Permalinks “/%year%/%monthnum%/%postname%.html” through mod_rewrite in the default .htaccess file WP created.

Subdirectory www.moon-blog.com/MySubdirectory/): normal PHP application. User defind permalinks. Located at directory “/MySubdirectory/”.

The problem is that the WordPress thinks My Subdirectory is 404, and do not allow Google to index my files.

I Try add some of php code into my php application to resolve this problem:

header("Status: 200 OK");

After adding that code, my PHP application in the subdirectory do not return 404 error again.

Related posts


Comments

3 Responses to “WordPress Mod Rewrite Make Subdirectory 404 Error”

  1. Jason Coleman on February 15th, 2008 7:45 pm

    Thank you very much. I was struggling with this for a few hours.

    I have a Wordpress plugin that adds some mod rewrites to redirect certain urls (like “/products/product1″) to a file in the plugin folder. IE6&7 were giving me random 404 errors… usually when I tried to refresh while the page was still loading.

    Anyway, adding the header 200 OK code to the top of the PHP scripts fixed it.

    This is a really weird fix. Shouldn’t PHP be sending 200 status by default anyway?

  2. Jerry on March 31st, 2008 6:38 pm

    Wow. That did work. Thanks so much for sharing this! The 404s were driving me nuts.

  3. Pashalex on April 9th, 2008 5:38 pm

    I am trying to install a new theme in word press 2.0 but any theme i chose it comes up with an error “Broken Theme” and “style.css is unreadable”.
    Any comments much appreciated.

Leave a Reply




Close
E-mail It