Managing .htaccess Files

Most web servers have configuration controls and commands that permit fine granularity of access control to pages and data that reside on the server. This can generally be done from either the system-wide configuration files or from the .htaccess files.

What is the .htaccess file?

Apache allows for decentralized management of configuration via special files placed inside the web tree. The special files are usually called .htaccess, but any name can be specified in the AccessFileName directive. Directives placed in .htaccess files apply to the directory where you place the file, and all sub-directories. The .htaccess files follow the same syntax as the main configuration files.

To find which directives can be placed in .htaccess files, check the Context of the directive.

For more information about managing .htaccess files, please, refer to the official Apache website.

How .htaccess files take effect

For Shared Hosting sites htaccess files are read on every request. Thus, changes made to these files take immediate effect.

For Shared Hosting NG sites the optimized search of .htaccess files is used: locations of .htaccess files are kept in CloudBlue Commerce. Thus, each time you add a new .htaccess file, log in to CCP and synchronize new .htaccess with CloudBlue Commerce. Follow the instructions below.

For new .htaccess file to take effect:

  1. Log in to CCP.
  2. Select your hosting subscription from the Subscription selector at the top of the panel screen.
  3. Go to Websites, click the name of the desired site domain.
  4. At the opened page click Web Hosting Settings Site settings are displayed.
  5. Select the General tab and then click the Sync htaccess button. Changes are applied in a second.

Note: The Sync htaccess button is shown only for Shared Hosting NG sites.