Agli Panci Agli Panci - 1 year ago 103
PHP Question

Restrict WHM/cPanel Access to user folder ~

I want to restrict access to direct folder in WHM, for example I have my website:

But at the same time if I open
, I can see the content of my website.

I need to restrict this access to open my website only from the domain.

Answer Source

You can place this rule as first rule in samplesite/.htaccess:

RewriteEngine On

RewriteCond %{HTTP_HOST} !^(www\.)?samplesite\.com$ [NC]
RewriteRule ^ - [F]

This will allow /samplesite/ to be accessed only from

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download