Search Knowledge Base by Keyword

How To Locate The .htaccess File In cPanel

.htaccess file is a configuration file that you can create or edit, to control some security settings or behavior for Apache-based websites.

This file contains configuration rules and directives, that are being read by the webserver. A web server may have multiple .htaccess files but there should be only one per directory for each individual website.

Below are the steps to locate the .htaccess File in cPanel-

  1. Login into your cPanel account. (Don’t know how to log in to your cPanel account? Click here)

 2. Locate and click on File Manager under the Files section.

3. User will be redirected to the File Manager page where you will see the files on your hosting account.

4. On the upper right corner of the page you will find the Settings button. Just click on it.

screenshot of file properties in File Manager

5. Once the user has clicked the Settings button, a small window will pop up and shows the Preferences of your File Manager.

Check the box for Show Hidden Files (dotfiles) and click on Save.

screenshot highlighting "show hidden files" in cPanel

6. To find the .htaccess file, the user can use the search box (also on the upper right corner of the page) by typing in “.htaccess” and clicking on Go Button

screenshot of search bar in File Manager

7. Another pop-up window will appear, showing the path for the existing .htaccess files you have on your hosting account.

Double click on the files on the list to go to the specific .htaccess file you wish to access.

screenshot of File Manager search results

8. User can also create a .htaccess file if it’s not existing, and should it be in the relevant website directory.

Locate the File button (with + icon) on the upper left corner of the screen. It will create a new file within the chosen path, then just name it “.htaccess” (including the “.” before the name).

screenshot of file upload in File Manager

9. To edit an existing .htaccess file, you must navigate to the path where the .htaccess is located and then right-click beside the file. It will show a menu with an Edit option. Just click on edit and another window will open for you to edit the file contents.

screenshot showing edit option for files in File Manager

 

Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.