bksi
bksi

Reputation: 1625

Apache 2.4 .htaccess file doesn't deny access

I tried many times with different methods, but i'm still unable to deny access to folder by .htaccess. Here is what i tried:

RewriteEngine On

<Directory />
   Require all denied
</Directory>

Second try:

RewriteEngine On

<RequireAll>
   Require all denied
</RequireAll>

Third try:

RewriteEngine On
Require all denied

What am i missing? Thanks

EDIT:

If this will help I'm using windows x64 version of apache. Downloaded here: http://www.apachelounge.com/download/win64/

LAST EDIT:

The problem is misspeled .htaccess name it was .htacess. Thanks for all of your time.

Upvotes: 2

Views: 6963

Answers (1)

Panama Jack
Panama Jack

Reputation: 24448

You should be able to use this in your htaccess file in the directory; your 2nd and 3rd try.

Require all denied

The <directory> directive should be used in your conf file. Also this is not a rewrite so having RewriteEngine will not matter. This is part of mod_authz_core

It maybe ignoring your .htaccess file. Check your conf file and make sure that you have AllowOverride All because in 2.4 the default is None.

Upvotes: 5

Related Questions