If you are looking for your .htaccess file and it isn't there, it's almost certainly just hidden. cPanel File Manager hides any file whose name starts with a dot until you turn on Show Hidden Files (dotfiles). This guide shows Instant Access Internet Services users how to show hidden files in cPanel and find .htaccess quickly.
Why .htaccess and other dotfiles are hidden
On Linux servers, a file or folder whose name begins with a period (a "dotfile") is treated as hidden. These are usually configuration files you don't need to see every day, so File Manager leaves them out of the list by default. Common hidden files you may be looking for include:
.htaccess- web server rules for redirects, HTTPS, caching and access control (usually inpublic_html).user.ini- per-folder PHP settings on some setups.well-known- a folder used for SSL certificate validation and domain verification.trash- File Manager's Trash folder, in your home directory
How to show hidden files in cPanel File Manager
- Log in to cPanel and go to Files > File Manager. File Manager opens in a new browser tab.
- Click Settings in the top-right corner of File Manager. The Preferences window opens.
- Tick the Show Hidden Files (dotfiles) checkbox.
- Optionally, under the default folder options, choose Web Root (public_html or www) so File Manager always opens straight in your website folder.
- Click Save.
The file list refreshes and hidden files now appear. The setting is remembered, so you only need to do this once.
Where to find your .htaccess file
For your main website, .htaccess lives in the public_html folder. Click public_html in the folder tree on the left and look near the top of the file list - dotfiles sort before other names.
A subdomain has its own document root (for example public_html/blog or a folder like blog.example.com), and it can have its own .htaccess file there. If you aren't sure which folder a subdomain uses, check Domains > Domains in cPanel and look at the document root column.
What to do if .htaccess still isn't there
If hidden files are showing and there's still no .htaccess, the file simply hasn't been created yet. That's normal for a brand-new site. You can create one:
- Open the
public_htmlfolder. - Click + File in the toolbar.
- Enter
.htaccessas the New File Name (include the leading dot). - Check that the location shown is
/public_html, then click Create New File.
WordPress normally creates its own .htaccess the first time you save Settings > Permalinks in the WordPress dashboard.
Before you edit .htaccess
A single typo in .htaccess can take your whole site down with a "500 Internal Server Error". Before making changes:
- Make a copy first: select the file, click Copy, and copy it to something like
/public_html/.htaccess-backup. If anything goes wrong, you can copy it back. - Change one thing at a time and reload your site after each change.
- If the site breaks, undo your last change straight away.
See How to Edit a File in cPanel File Manager for step-by-step editing instructions.
Common questions
I ticked the box but still can't see hidden files. What now?
Reload the File Manager tab in your browser, or click Reload in the toolbar. If it still doesn't work, open Settings again and confirm the box is still ticked and that you clicked Save.
Can I hide dotfiles again?
Yes. Open Settings, untick Show Hidden Files (dotfiles) and click Save. The files are still there - they're just hidden from view.
Why can't I see hidden files in my FTP program?
FTP programs have their own setting. In FileZilla, open the Server menu and choose Force showing hidden files. See How to Connect to Your Website with FileZilla (FTPS) for connecting with FileZilla.
I restored an old .htaccess and my site broke. Can I get the previous version back?
Yes, if it existed when a backup ran. You can restore a single file from a backup yourself - see How to Restore a File or Folder with JetBackup 5.
Related guides
- How to Use cPanel File Manager to Manage Your Website Files
- How to Edit a File in cPanel File Manager
- How to Force HTTPS on Your Website
- How to Set Up a 301 Redirect in cPanel
- How to Restore a File or Folder with JetBackup 5
Still stuck? Open a support ticket and the Instant Access Internet Services team will help.
