S
S
setevoi112019-12-01 11:47:36
Apache HTTP Server
setevoi11, 2019-12-01 11:47:36

How to put a password on the root directory through .htaccess, except for the images directory?

How to put a password on the root directory through .htaccess, with the exception of the images directory,
set the password, but how to exclude the directory?

AuthType Basic
AuthName "Thats protected Area!"
AuthUserFile /var/www/admin/data/www/*****/.htpasswd
Require valid-user
<Files .htpasswd>
   deny from all
</Files>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
DirectoryIndex index.php
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Vyaznikov, 2019-12-01
@setevoi11

SetEnvIf Request_URI "(/directory/)$" allow
Order allow,deny
Allow from env=allow
Satisfy any
You can also create .htaccess in that folder and add Satisfy any

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question