Understanding the .htaccess file

The .htaccess file is a powerful per-folder configuration file for Apache. It controls redirects, security rules, error pages and more.

Where to find it

It lives in your public_html folder. It starts with a dot, so enable Show Hidden Files in File Manager (Settings) to see it. WordPress and many apps create one automatically.

What it can do

  • Redirect URLs (301/302).
  • Force https.
  • Set custom error pages.
  • Block or allow specific IP addresses.
  • Control caching and protect files.

Important

A single typo in .htaccess can take your whole site down with a 500 error. Always back it up before editing, and if the site breaks, restore the previous version. Not comfortable editing it? We'll do it for you.

Was this answer helpful?

 Print this Article

Also Read

How to upload your website

Once your hosting is active, put your website online by uploading its files to the public_html...

How to set up an FTP account

FTP lets you upload and manage your website files with a program like FileZilla or Cyberduck....

How to change your PHP version

Different apps need different PHP versions. In CHPanel you choose the PHP version per website,...

How to set up a redirect

Redirects send visitors from one address to another — useful when you move a page, rename it, or...

How to create a custom 404 error page

A friendly page not found (404) page keeps visitors on your site instead of hitting a blank...