How to Access and Edit .htaccess File using cPanel Print

  • 125

What is .htaccess File:

.htaccess is a configuration file used by Apache and other web servers like LiteSpeed to manage a website’s behavior. A website owner can use this file to make changes to their website without having direct access to the server configuration files. A website’s .htaccess file can also be used to control its URL rewriting, security, and error handling.

Accessing .htaccess in cPanel:

  1. Log in to cPanel
  2. Go to the File Manager sectioncPanel - File Manager 
  3. Locate the .htaccess file in the public_html directory of your website
  4. If you can’t see the .htaccess file, you may need to enable it using the Settings option.cPanel - File Manager 'Settings'
  5. In the ‘Preferences‘ dialog, checkmark the ‘Show Hidden Files (dotfiles)
  6. Right-click on the file and select “Code Edit” or “Edit”
  7. Make any desired changes to the file
  8. Save the changes and close the file editor
  9. Refresh your website to see if the changes take effect.

.htaccess files have a significant impact on the behavior of your website. Changing the file incorrectly can cause your website to stop working correctly. Therefore, you should backup it up before you make any changes. For any .htaccess-related support, contact our support team


Was this answer helpful?

« Back