Showing posts with label no log-in box using .htaccess in apache2. Show all posts
Showing posts with label no log-in box using .htaccess in apache2. Show all posts

Friday, April 19, 2013

Enable authentication in apache2 using .htaccess

.htaccess is not working in apache2 :

If you have put .htaccess in your web project directory and it does not ask for username & password.
Follow this.

1) Check following directives in /etc/apache2/sites-available/default
<Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory>
   Where /var/www is path of the directory where you keep your web projects.

2) Add following directive in httpd.conf
<Directory /your/path/of/the/project> AllowOverride All </Directory>

3) Restart apache2.