Domanda

I use WHM and i need to make .htaccess in public_html work not for only sub folders to public_html, but also to all their subfolders and so on. Entire tree of folders from root is this possible?

e.g.

I store htaccess here public_html\.htaccess this folder should not be affected too. public_html\myfolder\images\thimbnails\red\

if this wont work can i use same commands from htaccess in apache.config?

rule is

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



Options +FollowSymlinks
RewriteEngine On

RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
È stato utile?

Soluzione

Settings from .htaccess files will be inherited by all subfolders. If you want a particular subfolder to not be affected, then you need to put a .htaccess file in it to override the default settings from the parent htaccess.

So if you deny a particular ip address in public_html/.htaccess and you want it to be allowed to see public_html/myfolder/images/thumbnails/red then you would need to put a .htaccess in that folder to allow from all or allow the blocked ip.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top