Skip to content
Host4u Limited

Showing hidden files and editing .htaccess

Support Portal  »  Knowledgebase  »  Viewing Article
There was a problem loading the comments.
  Print

Files whose names start with a dot, such as .htaccess, are hidden in File Manager until you turn on hidden files.

Showing hidden files

  1. In cPanel, open File Manager.
  2. Click Settings at the top right.
  3. Tick Show Hidden Files (dotfiles) and click Save.

Editing .htaccess

The .htaccess file for your main website is in public_html.

  1. Open public_html in File Manager.
  2. Select .htaccess and click Edit.
  3. Make your change and click Save Changes.

If there is no .htaccess file, create one with New File, named .htaccess.

Before you change it

  • Keep a copy. A mistake in .htaccess stops the whole website with a 500 error. Copy the file first (for example to .htaccess.bak) so you can put it back.
  • WordPress and other apps write to it. Add your own lines outside the # BEGIN WordPress and # END WordPress block, or WordPress may overwrite them.
  • Use a plain text editor. If you edit it on your own computer, use a plain text editor and upload it again; word processors add characters that break the file.
  • PHP settings and versions are changed in Select PHP Version, not in .htaccess. See Choosing a PHP version and changing PHP settings.

Share via
Did you find this article useful?  

Related Articles


Self-Hosted Help Desk Software by SupportPal