Files that start with a dot, such as .htaccess, are hidden in File Manager until you ask to see them.
Steps
- In cPanel open File Manager.
- Click Settings in the top right.
- Tick Show Hidden Files (dotfiles) and click Save.
Your .htaccess now appears in public_html. If there is none, click + File and create one with exactly that name.
Before editing it, right-click and Copy it to .htaccess-backup. One typo in this file can take the whole site down with a 500 error, and the copy gets you back in seconds. If that happens, see Fixing a 500 Internal Server Error.
If it doesn't work
- The file is still missing: make sure the Document Root for dropdown in Settings is set to the domain you are working on.
- Your editor adds a
.txtending: use the cPanel editor, or check the name carefully after upload.