Start a conversation

For what does .htaccess file for and its syntax

The .htaccess file is used to set the rules for the web server only within a specific directory where it is located, without affecting the entire server. This file name is generally accepted, so you can see it on other sites and projects.

Since the Apache web server is case sensitive and the names .HTaccess and .htaccess will be different for it, we recommend that you avoid capital letters in its name.

In most cases .htaccess file directives has a higher priority over some web server settings. Changes to this file take effect immediately after saving, no reboot of the web server is required.

The .htaccess file has a syntax similar to the configuration files for web servers (httpd.conf). Each new directive must start on a new line. If you want to add a comment or disable a directive without removing it, add a # at the beginning of the line.

The basic set of directives will be covered in the following articles:

Choose files or drag and drop files
Was this article helpful?
  1. Alexey Momot

  2. Posted
  3. Updated