What is .htaccess file?

A .htaccess file allows you to customise the apache web server and alter the way that requests for your site are handled. This can include items such as displaying a different index page, specifying custom error pages or redirecting your website to https to make all page requests secure.

The customisations are applied by creating a file within your website public_html directory called .htaccess (note the full stop at the beginning of the file). Many FTP clients will treat files starting with a full stop ot be a hidden file and so you may need to enable the display if hidden files in your client if this is the case.

The file itself is just a plain text file and will contain the directives that are required to make the customisations, for example:

ErrorDocument 404 /404.html

In the above line, this sets a custom error document so that any pages which result in a 404 not found error display /404.html to the visitor.

Please see https://httpd.apache.org/docs/current/howto/htaccess.html for further detailed information
  • .htaccess, customisation, apache
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

.htaccess File Generator

Instructions This page will allow you to generate a .htaccess file to use within your...