Thursday, 2 July 2015

How to use .htaccess file on Apache server

You need to have AllowOverride AuthConfig directive in httpd.conf file in order for these directives to have any effect. Look for DocumentRoot Directory entry. In this example, our DocumentRoot directory is set to /var/www. Therefore, my entry in httpd.conf looks like as follows:

<Directory /var/www/html>
Options Indexes Includes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all

Save the file and restart Apache
If you are using Red Hat /Fedora Linux:
# service httpd restart

If you are using Debian Linux:
# /etc/init.d/apache-perl restart

No comments:

Post a Comment