I'm discussing with my sysadmin about whether to allow .htaccess files. I noticed all over the EE file tree there are .htaccess files to prohibit access to files, such as to system/user/config/config.php. But they also appear to have built-in direct-access controls, such as:

if ( ! defined('BASEPATH')) exit('No direct script access allowed');

So, .htaccess files a good idea to have on? Using EE 4.3.6.

up vote 2 down vote accepted

No, .htaccess file is not needed for EE install. If you don't make .htaccess file then also EE will run. But, it is advisable to keep .htaccess file for removing the index.php from URL, leverage browser caching and gzip compression.

.htaccess files are used to override settings which is set in the apache configuration. If you don't want to change, then you don't need (and shouldn't have) an .htaccess file.

.htaccess files are specifically for people who don't have permission to root.

  • We've actually placed the index.php removal and gzip directives in httpd.conf, so in this case, it looks like we can get away with disabling .htaccess files (AllowOverride none). Thanks for your explanation. – jphansen Oct 10 at 20:14

htaccess is not needed, however, to remove the index.php from the url you'll need it Also for setting cache control headers it's usefull as wel as for caching and gzip output/extraction

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.