How to set up rules and redirects in .htaccess?

.htaccess is a directory-level configuration file supported by the Apache web server. It is used to alter web server configuration (enable or disable additional features) for the specific account without changing global server settings.

The .htaccess file takes effect over the entire directory it is placed in, including all files and subdirectories. The changes made in this file will be implemented immediately and no server restart is required.

To access the main .htaccess file of your hosting account, follow the steps below:

1. Log into your cPanel.

2. Navigate to the section Files > File Manager

3. If you wish to edit .htaccess file for your main domain, navigate to public_html folder. If you need to make some changes to the addon domain, move to public_html/youraddondomain.com folder.

Once there, make sure that Show Hidden files (dotfiles) option is enabled in Settings menu

4. Locate .htaccess file, right-click > Edit

 5. If there is no .htaccess file located in your File manager, feel free to create a new one using File option

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How do I add an Apache handler?

1. Click on the “Apache handlers” link in Cpanel. (under the 'site management header.)2. Enter...

How do I change my account password in Cpanel?

1. Click on 'Change Password' under the 'Site Management' header in Cpanel. 2. Enter your...

How do I create custom error pages?

Error pages are served to Internet users when any one of a variety of errors occur, such as when...

How do I login to Cpanel?

You can login to Cpanel with the url that is in your Welcome email:...

How do I password protect a directory?

You can password protect directories within your site from unauthorized users by using 'Web...