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.

2 Answers 2


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
    Commented Oct 10, 2018 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 agree to our terms of service and acknowledge you have read our privacy policy.

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