Select Page

Move .htaccess contents from .htaccess file to config directives in the Apache config file, this should improve site performance and make config maintenance more centralized too.

For instance rename your /var/www/.htaccess as /var/www/mysite.rule and include this file in apache vhost file as mentioned below.

<Directory "/var/www">
 Options Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
 AllowOverride None
 Order deny,allow
 Allow from all
 AddHandler application/x-httpd-php .html .htm .php
 AddType application/x-httpd-php .php
 
 Include /var/www/mysite.rule
</Directory>

 

You can create multiple rules file based on your web directory structure and include in the apache directives.