What is .htaccess
.htaccess is a per-directory configuration file for the Apache web server. It lets you set up redirects, protection, caching and compression without access to the server configuration. The rules apply to the directory containing the file and all its subdirectories.
Tips
- HTTPS and www — pick one main address for your site and redirect all the others to it, so search engines won’t treat the site as duplicate content.
- Caching and compression make pages load several times faster and improve your Google PageSpeed score.
- HSTS should only be enabled once the SSL certificate definitely works on all subdomains: browsers remember this setting for a year.
- If the site shows a 500 error after a change, restore the previous file and check the syntax.
The generator produces Apache 2.4 rules that work on MEVCORE shared hosting.