.htaccess is a configuration file for use on web servers running the Apache Web Server software. When a .htaccess file is placed in a directory which is in turn ‘loaded via the Apache Web Server’, then the .htaccess file is detected and executed by the Apache Web Server software. These .htaccess files can be used to alter the configuration of the Apache Web Server software to enable/disable additional functionality and features that the Apache Web Server software has to offer. These facilities include basic redirect functionality, for instance if a 404 file not found error occurs, or for more advanced functions such as content password protection or image hot link prevention.

Locate htaccess file in cPanel filemanager

Step-1: Login to cPanel > FileManager.

Step-2: Open your website directory, and .htaccess file should be there.

Your .htaccess file could be hidden by default. To see it,

Step-3: Click the Settings from the top left corner.

Step-4: Check Show Hidden Files (dotfiles) and click save!

Step-5: Right click on the .htaccess file and select edit.

Step-6: Another popup will show. Click edit.

Step-7: Paste your code and click save.

If you do not find .htaccess file after check hidden files, you can create a new .htaccess file. Just follow the below steps after Step-4:

Create .htaccess file:

Step-1: Click the +File option from the top left corner in filemanager.

Step-2: Enter file name .htaccess (use dot before the name) and click create new file.


Start Cloud Hosting Today