WordPress.org

Ready to get started?Download WordPress

Forums

WP intercepting ALL 404 errors from main site? (2 posts)

  1. _ck_
    Member
    Posted 8 years ago #

    I noticed a strange behavior and I am not sure how it's even possible since WP uses a RewriteBase in .htaccess.

    I have WP running off a subdirectory called /news/ as there are a handful of static pages above it in the webroot.

    Apparently WP somehow is catching all 404 errors for the website even when they are not off /news/ ?? Even above /news/ (ie. / )

    ie.
    http//example.com/cgi-bin/typo.cgi
    http//example.com/nonexistantpage
    will all end up at the WP 404 page instead of the main 404 page?

    I have the following in my .htaccess

    # wordpress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /news/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /news/index.php [L]
    </IfModule>

    there is absolutely nothing else in .htaccess that could route to /news/ so I have no clue how it's ending up there?!

    The server is using Apache 1.33 on CentOS 3 if that matters.

    Thanks for any help / ideas...

  2. _ck_
    Member
    Posted 8 years ago #

    Okay figured out my own answer again sorry.
    But this might help someone else in the future.

    When you run WP in a sub-directory, the special .htacesss goes into that sub-directory, not the webroot .htacess !

    Didn't realize that, though it seems obvious now.

Topic Closed

This topic has been closed to new replies.

About this Topic