Moving you WordPress .htaccess file to your vhost configuration files will indeed improve the performance of apache. By configuring your virtual host to point to your .htaccess file, you’re telling apache where to load the configuration versus having to maintain all .htaccess changes each time your wordpress blog updates, including plugins.
- Caveat, each time any .htaccess file changes you need to reload Apache.
- Caveat, if you remove a .htaccess file you’ll need to remove the directive including it in the virtualhost configuration file.
Here’s how to speed up Apache by removing AllowOverRide All –
<VirtualHost *:80> ServerAdmin firstname.lastname@example.org DocumentRoot "/var/www/website" ServerName website.biz ServerAlias *.website.biz ErrorLog "/var/log/apache2/website-error_log" <Directory /var/www/website/> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all Include /var/www/website/.htaccess </Directory> <Directory "/var/www/website/wp-content/cache/"> Include /var/www/website/wp-content/cache/.htaccess </directory> <Directory "/var/www/website/wp-content/uploads/wpcf7_captcha/"> Include /var/www/website/wp-content/uploads/wpcf7_captcha/.htaccess </directory> <Directory "/var/www/website/wp-content/themes/NewTheme/cache/"> Include /var/www/website/wp-content/themes/NewTheme/cache/.htaccess </directory> <Directory "/var/www/website/wp-content/blogs.dir/9/files/wpcf7_captcha/"> Include /var/www/website/wp-content/blogs.dir/9/files/wpcf7_captcha/.htaccess </directory> </VirtualHost>
BONUS TIP: use the below grep to find all .htaccess files within your web root!
find /var/www/ | grep '.htaccess'
Now if you’re installing wordpress for thte first time or you’re not done tweaking the configuration I’ll recommend that you use the .htaccess with allowoverride set to all until you’re done setting things up. But once the website is done and all set up with all the plugins you’re going to use you should disable allowoverride and let apache load the .htaccess directive from within the virtual host configuration.