Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 20th, 2012, 08:45 PM
ttremain ttremain is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2005
Location: Vancouver, WA, USA
Posts: 364 ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Days 7 h 52 m 28 sec
Reputation Power: 188
.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...

Any assistance?
__________________
Thomas Tremain

Reply With Quote
  #2  
Old March 21st, 2012, 01:13 AM
E-Oreo's Avatar
E-Oreo E-Oreo is offline
Lost in code
Click here for more information.
 
Join Date: Dec 2004
Posts: 7,944 E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)E-Oreo User rank is General 91st Grade (Above 100000 Reputation Level)  Folding Points: 945 Folding Title: Novice Folder
Time spent in forums: 2 Months 10 h 16 m 54 sec
Reputation Power: 7053
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.
__________________
PHP FAQ
How to program a basic, secure login system using PHP
Connect with me on LinkedIn


Quote:
Originally Posted by Spad
Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

Reply With Quote
  #3  
Old March 21st, 2012, 02:31 AM
ttremain ttremain is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2005
Location: Vancouver, WA, USA
Posts: 364 ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Days 7 h 52 m 28 sec
Reputation Power: 188
Quote:
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.


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.

Reply With Quote
  #4  
Old March 21st, 2012, 05:51 PM
ttremain ttremain is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2005
Location: Vancouver, WA, USA
Posts: 364 ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Days 7 h 52 m 28 sec
Reputation Power: 188
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...

The fix:

In the root of the add-on domain, I created a .htaccess file, and placed in it only:

RewriteEngine On
RewriteBase /

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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > .htaccess for subfolder to ignore .htaccess in root folder

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap