Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to be able to use .htaccess in all subfolders for full depth. E.g. I have .htaccess in public_html folder:


How I make it to work for the folder small as well?


It only enforces up to home directory not more.

ErrorDocument 403 http://google.com
Order Deny,Allow
Deny from all
Allow from

Options +FollowSymlinks
RewriteEngine On

RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
share|improve this question
htaccess rules do inherit to sub-directories. See here If you're not seeing that behavior, it's more likely a problem with the rules themselves, and you need to provide an example. – Su' Nov 3 '11 at 23:40
@Su' Can you post your comment as an answer – jflaflamme Jan 7 '12 at 14:16

Are you using Apache? Subdirectories are supposed to inherit .htaccess by default under Apache.

Check your /etc/apache2/httpd.conf file. It could be that you have a <Directory> directive that is keeping your .htaccess from being applied to subdirectories, like it should by default.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.