IMB
IMB

Reputation: 15889

How to use .htaccess deny from all on subdirectory

My folder structure is like this

I want to place the .htaccess file at /home/ and I only want to deny from all the /home/user1/ directory.

I don't want to place the .htaccess file inside /home/user1/.

Is this possible?

Upvotes: 1

Views: 134

Answers (1)

Daniel Gruno
Daniel Gruno

Reputation: 144

If you have access to the httpd configuration files themselves, you should solve this in the config file, and not via .htaccess.

To deny access to a specific resource, use the directive:

<Directory /home/user1>
    #for httpd 2.4, use: Require all denied
    deny from all
</Directory>

Upvotes: 1

Related Questions