Apache web servers use an .htaccess
file for configuration. An .htaccess
file comes with directives and settings for websites and folders. With .htaccess
it’s easy to customize website headers, set up redirections and define other website variables.
Default support for .htaccess
An .htaccess
file is used by many open source CMS, like WordPress, Magento and Drupal. Servebolt has full support for .htaccess
, so no customization of .htaccess
is necessary. It just works!
Fast and easy password protection
We can also use .htaccess
for server based password protection, with a .htpasswd file. This is an easier solution than using PHP with a database.
Better performance with .htaccess
Since .htaccess
is parsed with each web request (scripts, images, css etc), we recommend keeping it as small as possible. If you want to setup a large number of redirections, it’s often better to use a dedicated redirection plugin or function.
Managing .htaccess errors
Don’t forget to check the server error log if you’re experiencing issues with .htaccess
. .htaccess
errors are often listed there since .htaccess
is a part of the Apache web server setup.