User login

Include .htaccess in VirtualHost Document for performance

<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

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.