How to edit your .htaccess file

Getting To Know Your .htaccess File

The .htaccess file contains directives (instructions) that tell the server how to behave in certain scenarios and directly affect how your website functions.

Redirects and rewriting URLs are two very common directives found in a .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 a .htaccess File

  • Edit the file on your computer and upload it to the server via FTP
  • Use an FTP program's Edit Mode
  • Use SSH and a text editor
  • Use the File Manager in cPanel

The fastest and easiest way to edit a .htaccess file for most people is to use the File Manager in cPanel; this article covers how to edit using this method and applies to Linux web hosting, such as DigitalJetstream Shared, Reseller, VPS and Linux Dedicated Servers.
 


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 Open the File Manager
  1. Log into cPanel.
  2. In the Files section, click on the File Manager icon.
  3. Check the box for Document Root for and select the domain name you wish to access from the drop-down menu.
  4. Make sure Show Hidden Files (dotfiles)" is checked.
  5. Click Go. The File Manager will open in a new tab or window.
  6. Look for the .htaccess file in the list of files. You may need to scroll to find it.
To Edit the .htaccess File
  1. Right click on the .htaccess file and click Code Edit from 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.
  2. A dialogue box may appear asking you about encoding. Just click Edit to continue. The editor will open in a new window.
  3. Edit the file as needed.
  4. Click Save Changes in the upper right hand corner when done. The changes will be saved.
  5. Test your website to make sure your changes were successfully saved. If not, correct the error or revert back to the previous version until your site works again.
  6. Once complete, you can click Close to close the File Manager window.
Note: Instead of using the cPanel method, many people find changing the .htaccess file via FTP or SSH an easy alternative.

DigitalJetstream Website Hosting
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

What Is POODLE?

POODLE is the term used to describe the security vulnerability in the SSL Version 3...

What is SSL Version 3 (i.e. SSLv3) and what uses it?

SSLv3 is a cryptographic protocol utilized to securely submit data over the HTTPS protocol....

Who does POODLE affect?

Any merchant using Internet Explorer 6 (IE6) to access secure DigitalJetstream.com pages or any...

What is DigitalJetstream doing to resolve the POODLE issue?

On November 4, 2014, DigitalJetstream will be disabling the use of SSLv3 within our systems. This...

What should I do to make sure I'm not affected after November 4th?

Immediately contact your web or solution developer to determine if you are using SSLv3 to submit...