• I’m currently running WP 2.0. I have been trying to set up permalinks, and I’m running into some problems. I have the index.php and .haccess files for my blog in the root directory of my server. All other WordPress files are in a /wordpress/ subdirectory (and all of that is set up correctly in the Admin Options). I have set up permalinks to be: /%category%/%postname%/. The .htaccess file is currently:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php
    </IfModule>

    # END WordPress

    The permalinks work great, and there are no problems with the actual blog. All post titles and categories are linking fine.

    However, when I try to access other subdirectories for my site (completely outside of the blog) that already have their own .htaccess files (password protection) within their own directories, I am getting 404 errors when trying to access those pages. These 404 errors are appearing within the template of my blog, so it’s like it’s acting as though those other subdirectories are part of the blog when in fact they are not.

    How do I coordinate multiple .htaccess files in different directories to prevent this problem? Please be as exact as possible, as I’m very new at this type of thing.

    Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • what’s the location for the WordPress .htaccess file? /.htaccess or /wordpress/.htaccess ?

    also, you might want to refer to this post: https://www.mikeschepker.com/wordpress/2005/12/wordpress-20/ though i’m not sure if it’s related somehow to the issues you’re having.

    Thread Starter catrionac

    (@catrionac)

    The WordPress .htaccess file is in /.htaccess.

    I’ve tried renaming the wordpress directory to something different, and I’m still getting the same issue. The problem is that my other .htaccess file is inheriting rules from the parent file (the WordPress .htaccess file), which is causing 404 errors. Is there some kind of command to prevent inheriting the root .htaccess rules in subdirectories?

    try changing the RewriteBase / to something a more specific directory. using /.htaccess will force subdirectories to inherit the defined directives as you’ve mentioned. you can try to revert using “RewriteEngine Off” – just keep a lookout on this post, i’m pretty sure there more folks out there who would be willing to share their knowledge/experience with complex mod_rewrite rulesets.

    I’ve found a fix for this through my hosts help site (Dreamhost who do one click installs of WP2.0)

    You have to modify your .htaccess by adding the following before the WordPress definition:

    <Files .htaccess>
    order allow,deny
    deny from all
    </Files>

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_URI} ^/directoryname1/(.*)$ [OR]
    RewriteCond %{REQUEST_URI} ^/directoryname2/(.*)$ [OR]
    RewriteCond %{REQUEST_URI} ^/failed_auth.html$
    RewriteRule ^.*$ - [L]
    </IfModule>

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

    The very first bit should be in all your .htaccess files to prevent people from viewing the file – after that you have the RewriteCondition defining your extra directory, just rename directoryname1 to whatever your directory is; you can add more or less by using the [OR] condition (this must be at the end of the line otherwise the failed_auth won’t work).

    I use this to access my password restricted statistics pages, without having to ftp in and rename the .htaccess file temporarily ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘.htaccess conflict problem’ is closed to new replies.