kwbridge Posted July 9, 2008 Posted July 9, 2008 I am having a terrible time with mod_rewrite in my htaccess files. I have a wordpress installation at the root level of my siteand am using the rewrite rules to change the permalinks. Today I discovered that this htaccess file was affecting all lower level directories except for one, which is another wordpress installation. Other directories being affected are one with regular .shtml files, another wordpress installation and a password protected directory. The lower lever directory that is working fine also has mod_rewrite rules for the permalinks as well as rules for a wordpress cache plugin. All other directories do not have rewrite rules and are redirected to the root level's 404 page when a page can not be found rather than it's own. And the password protected directory can not be accessed at all - it simply gets routed to the root level 404 as well. The root level htaccess is standard for wordpress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> A google search showed me that if I didn't want the root level htaccess to write to lower level that I should add lines like this RewriteRule ^games/.*$ - [PT] - this is the password protected directory and this should follow RewriteBase / I added this line for each subdirectory that I did not want to be affected but nothing has changed - all 404's and the password protected directory are going to the root levels 404. I thought it was strange that one wordpress installation was not affected - the only thing that I can determine is that is has rewrite rules for permalinks as well but the other wordpress subdirectory does not. This one uses the default permalink structure because it contains other (messy) php code that does not work if I change from the default (this would be a project for another day). If I change the root level's permalinks to default everything works properly but this will change the links and the links would not be as friendly to search engines so I don't want to do that. If I remove the password protection I can also access that directory. So, I guess there is some sort of conflict and the lower levels that aren't working properly need specific instructions in their own htaccess or perhaps I don't have this line RewriteRule ^games/.*$ - [PT] correct in the root htaccess If you need the specific url's, please let me know. I wasn't sure if I should include them in this post or not. Thanks in advance. Kim Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.