In my /var/www/
directory I have many directories some like:
/var/www/impdata/
/var/www/data/
So can I achieve this:
When I go to: www.websitename.com/data/
it should give a 404
error.
And when I do www.websitename.com/data/welcome.php
it should work.
And when I do www.websitename.com/impdata/
it should ask for username and password.
And when I do www.websitename.com/impdata/welcome.php
it should work.
So how can i write my .htaccess
and .htpasswd
to achieve this?
This is my current .htaccess
file and it is in the /var/www/
directory:
Options -Indexes
DirectoryIndex disabled
<Directory /var/www/impdata>
# All access controls and authentication are disabled
Satisfy Any
Allow from all
</Directory>
My current .htpasswd
file in the /var/www/impdata/
directory:
try:XYZXYZXYZXYZ