» Including .htaccess in apache2.conf with AllowOverride None slows down Apache?
Including .htaccess in apache2.conf with AllowOverride None slows down Apache?
|June 15, 2014
Posted by forumadmin
If you have access to the main server configuration file (usually called
httpd.conf), you should add the logic from the
.htaccess file in, for example, a
<Directory> section in the main configuration file. This is usually the recommended way, as using
.htaccess files slows down Apache! (Source)
I think it essentially means, if possible, I should
Include httpd.conf along with the
AllowOverride None directive in
But semantics (or whatever) aside, why can’t I simply include
.htaccess itself? For my convenience I am doing it like this…
# [... ORIGINAL CONTENTS OF APACHE2.CONF ...]
DirectoryIndex index.php index.html
.htaccess file included in
apache2.conf, and the
AllowOverride None directive in place, I can simply add all my site’s rewrite rules in
If need to use another .htaccess file for another sub-directory, I simply add another
Include for the new
.htaccess file in
apache2.conf just the way I am doing it now.
My question is, is this just as performant as using
httpd.conf? (I believe I was told otherwise here, which is why I am asking.) If not, why not?
Reason why I prefer using .htaccess: My server runs WordPress, and some WordPress plugins I use (SEO, caching, etc.) add rewrite rules in .htaccess files. By using .htaccess I don’t have to do this manually myself, and can simply let the plugins do their job.
More Related Questions
- Apache Rewrite Rule that Only redirects traffic on even timestamps I am trying to create an apache redirect rule that will redirect half of my traffic to one location.
The way I want to do this is by only redirecting traffic that arrives with an even […]
- Apache 2.2 disable unconfigured subdomains There is a webserver which has example.com, www.example.com, my.example.com, shop.example.com, static.example.com. All sites except www.example.com is on https. My problem is when I type […]
- Apache FilesMatch : How to only match assets with a timestamp appended I just wrote and answered a question regarding what apache FilesMatch recognizes as the filename; see Here for more on that, but the skinny is that apache does not recognize anything after […]
- Error message "Forbidden You dont have permission to access / on this server" I have configured my Apache by myself and have tried to load phpMyAdmin on a virtual host, but I received:
403 Forbidden You don't have permission to access / on this server
- Forbidden You dont have permission to access / on this server I have configure my Apache by myself and try to load phpMyAdmin on virtual host, but received "403 Forbidden You don't have permission to access / on this server".
- Apache URL forwarding/rewriting I need some help with the rewrite rule for apache. My requirement is to forward all the 3 below links to the default sign in page.
"http:// cars.company.com","cars.company.com","https:// […]
- Apache could not be started – ServerRoot must be a valid directory and Unable to find the specified module i'm using xampp portable server and i'm having some trouble with apache http server, it says "ServerRoot must be a valid directory"
Command line output:
Please close this command only […]
- .htaccess: RewriteEngine not allowed here I uploaded the .htaccess to the server and received an Error 500 (Internal Server Error).
And in the error log I had the following error:
.../.htaccess: RewriteEngine not allowed […]
- Apache virtual hosts on OSX 10.9.1 I've set up everything according to
And then followed the guide for virtual hosts config […]
- Forbidden You dont have permission to access on this server. Centos 6 / Laravel 4 i got a problem after i finish to set up LAMP and installed my laravel 4 application. Everything seem went well, when i go on my ip address url, it show me the first page of my application […]