Bluehost Web Hosting Help
How To Edit An .htaccess File - Edit htaccess file in cPanel's File Manager
The .htaccess file contains directives (instructions) that tell the server how to behave in certain scenarios and directly affects how your website functions. Redirects and rewriting URLs are two very common directives found in an .htaccess file, and many scripts such as WordPress, Drupal, Joomla and Magento add directives to the .htaccess so those scripts can function.
It is possible that you may need to edit the .htaccess file at some point, for various reasons. This article covers how to edit the file, but not what to change. (You may need to consult other articles and resources for that information.)
There are many ways to edit an .htaccess file.
- Edit the file on your computer and upload it to the server via FTP.
- Use an FTP program's "Edit" mode that allows you to edit a file remotely.
- Use SSH and a text editor to edit the file.
- Use the File Manager in cPanel to edit the file.
The fastest and easiest way to edit an .htaccess file for most people is to use the File Manager in cPanel. This article covers how to edit it using this method.
How to Edit .htaccess in cPanel's File Manager
Before we do anything, it is suggested that you backup your website so that you can revert back to a previous version if something goes wrong.
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.
- Make sure "Show Hidden Files (dotfiles)" is checked.
Click the "Go" button.
The File Manager will open in a new tab or window.
- 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.
Recommended Help Content
How To Edit Website Files With The File Manager - File Manager Guide
I am trying to edit my web page and I have no idea how to? I need to know how to go into the site and fix it. My webpage has a error in the first paragraph. I don't know how to fix it? Can you help?
File Manager - How to Upload Files
This article will walk you through uploading files using the File Manager
File Manager - How to Create, Remove, and Edit Files
This article will walk you through creating, removing, and editing files with the file manager.
Related Help Content
Accessing the File Manager
This article will give a basic overview of the File Manager and explain how to access it.
File Manager - How to Extract Files from an Archive
This article will walk you through extracting compressed files using the File Manager.
File Manager - How to Copy and Move Files
This article will walk you through copying and moving files using the File Manager.
What is the .htaccess file and where can I find more information?
File Manager - How to Compress Files into an Archive GZip
This article will explain how to utilize GZip through the file manager.
Explains the use of DirectoryIndex and how to use it.
Navigating the File Manager
This article will walk you through navigating the File Manager.
IP Deny Manager Tool
This article will explain how to utilize the IP Deny Manager tool in cPanel.