Home ›
Include .htaccess in VirtualHost Document for performanceInclude .htaccess in VirtualHost Document for performance
Submitted by Benjamin Melançon on April 21, 2009 - 8:13am
<VirtualHost *:80>
DocumentRoot /www/docs/example.com
<Directory "/www/docs/example.com">
AllowOverride None
RewriteEngine On
# etc
</Directory>
</VirtualHost>
The above is what you need to know before including this:
Example Clean URL configuration of httpd.conf for performance
http://drupal.org/node/43788
Resolution
Searched words:
include .htaccess in VirtualHostIs it possible to have an Include in the <VirtualHost> configuration to include the .htaccess? Thus not having to permit AllowOverride All, and the rewrite rules get parse once on Apache start.
.htaccess can just be included everything .htaccess does can be done at that level
Include could include anything. struggling to work out where in the vhost config it should be. In the root of the <VirtualHost> or Further down into <Directory>
It works when I use the include in the <Directory /var/www> like element, not <Directory />
<Directory> is directive not a element*
for rewrite rules to work it will have to be in the path to your site root, in case you are in a subdirectory of /var/www
going off the default debian vhost, it has DocumentRoot /var/www, <Directory /> and lastly <Directory /var/www/>, but the include works in the later
Comments
Post new comment