March 20th, 2012, 08:45 PM
.htaccess for subfolder to ignore .htaccess in root folder
I'm trying to make the .htaccess file in a subfolder (actually an add-on domain) NOT also process rules in the root folder.
I've spent the last hour or more searching Google...
March 21st, 2012, 01:13 AM
As far as I know you can't. However, you can override most directives with a new value.
If by rules you mean rewrite rules though, it might not be possible to override them. Try putting RewriteEngine off into your subfolder .htaccess file. If that disables the rules, then you can override them. If it doesn't, then you can't.
If you can't, then you'll need to modify the rules in the parent directory's .htaccess file so that they don't apply to URLs referencing the subfolder.
For an add-on domain it does seem kind of odd that the parent directory's .htaccess file is being processed; if you're accessing the subfolder using the add-on domain directly I wouldn't think that the parent folder would be under the add-on domain's document root, and as far as I know, .htaccess files that are above the document root would not be processed.
March 21st, 2012, 02:31 AM
That is what I show from tests on my own servers, as well. My client has yet to give me FTP access in to take a look at this account. I posted this based upon his notes, and the more I look, the more I think he's mistaken.
Apache on *MY* servers, map the add-on domain DIRECTLY to it's own folder, so the public_html/.htaccess should never be accessed.
This thread may be moot... Then again, you have probably confirmed what I thought to be true.
March 21st, 2012, 05:51 PM
My client was correct. When he went to his add-on domain, it was reading the .htaccess file from the root domain.
I was then able to recreate this on my own servers...
In the root of the add-on domain, I created a .htaccess file, and placed in it only:
If I left the .htaccess file in this folder blank, it again read the .htaccess file for the primary domain.
All servers tested were running Centos, and cPanel.