Finding and Editing the .htaccess file.
At some time during your webmaster career you will come across the “.htaccess” file. Like anything new I had no idea what to do with it – normally by default the .htaccess file is hidden – so until you unhide the file you will never even know that it exists.
In short – in the top right corner in File Manager you will see a “SETTINGS” button – view picture below.
Once you clicked the button you will see this screen:
No when you go back to the main public_html directory you will be able to see and edit the .htaccess file.
The fastest and easiest way to edit an .htaccess file for most people is to use the File Manager in cPanel.
To edit the .htaccess file, first we will open the File Manager:
- Login to cPanel.
- Click on “File Manager” in the “Files” section.
- Select “Document Root for:” and select the domain name you wish to access.
- Look for the .htaccess file in the list of files. You may need to scroll to find this file.
- Right click on the file and click on “Code Edit” on the menu. (Alternatively, you can click on the icon for the .htaccess file and then click on the “Code Editor” icon at the top of the page.)
- A dialogue box may appear asking you about encoding. Just click on the “Edit” button to continue.
The editor will open in a new window.
- Edit the file as needed.
- Click on the “Save Changes” button in the upper right hand corner when done.
The changes have been saved. Test your website to make sure it has the desired effect. If not, correct the error or revert back to the previous version until your site works again.
- Once complete, you can click “Close” to close the window.
Once complete, you can click “Close” to close the window.