Is there any reason (security, performance, etc.) that I should not use .htaccess in an Apache production/live environment?
Should I use .htaccess in an Apache production/live environment
.htaccessapache-2.2
Related Topic
- Apache .htaccess – How to Use the
Directive - Disable .htaccess from apache allowoverride none, still reads .htaccess files
- Apache 2.4, mod_proxy_fcgi not honouring .htaccess, work around needed
- Use Gulp to modify the .htaccess file with different configurations for Dev & Production
- Nginx – Converting .htaccess to nginx. Rewrite not working as it should
Best Answer
Apache's official recommendation is to avoid use of
.htaccess
unless it's absolutely necessary.If
AllowOverride
is set to anything other thanNone
, then every single request that the system receives for a context withAllowOverride
enabled will cause the Apache process to check for an.htaccess
file in every part of the filesystem tree that could potentially contain a.htaccess
that would apply to the current request.See here: