How to Show Hidden Dotfiles and Safely Edit .htaccess in cPanel

47 views
Short answer: In cPanel File Manager, click 'Settings' in the top-right corner, check 'Show Hidden Files (dotfiles)', and save to reveal concealed configuration files like .htaccess.

Learn how to reveal hidden files (dotfiles like .htaccess, .user.ini, and .env) in cPanel File Manager and edit configuration directives safely.

Before you start: Back up your site files and database and download the backup to your own computer. How to take a full backup

Quick reference

Location cPanel > Files > File Manager > Settings (top-right gear)
Option Name Show Hidden Files (dotfiles)
Common Dotfiles .htaccess, .user.ini, .env, .well-known

Steps

  1. Open File Manager: Under Files, click File Manager.
  2. Enable Hidden Files in Settings:
    • In the top right corner of the File Manager toolbar, click the Settings button (gear icon).
    • In the Preferences modal, check the box for Show Hidden Files (dotfiles).
    • Click Save.
  3. Locate and Edit .htaccess:
    • Navigate to your website root directory (usually public_html).
    • Right-click the .htaccess file and select Edit.
    • Confirm the UTF-8 encoding dialog and click Edit.
  4. Best Practice - Create a Backup: Before modifying any directives, right-click .htaccess and select Copy to create .htaccess.bak. If your edits trigger an HTTP 500 error, restore the backup immediately.

Troubleshooting and tips

  • File Still Not Visible: If .htaccess does not exist in public_html, click the + File button in the top left, name it exactly .htaccess (including the leading dot), and click Create New File.
  • HTTP 500 Error After Editing: Syntax errors or unsupported directives will break the site. Revert your changes or restore .htaccess.bak.
Need more help? If you run into an error while following these steps, open a ticket with technical support and our team will look into it. Open a ticket
Was this article helpful?
No, I need more help
Didn't find your answer?
Under 3 minutes
Submit Support Ticket