.htaccess tips and tricks

1.
Is .htaccess enabled?
In virtual host configuration:
AllowOverride None
change it to
AllowOverride All

2.
restart apache /etc/init.d/apache2 restart

3.
In to folder you want to protect, make file with name .htaccess
Sample .htaccess file for password protection:
AuthType Basic
AuthName "restricted area"
AuthUserFile /usr/local/var/www/html/.htpasses
require valid-user

4.
create pass file /usr/local/var/www/html/.htpasses

5.
make new pass
htpasswd -c /usr/local/var/www/html/.htpasses jimmy


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *