.htaccess is a settings file for the web server. It sits in your website's folder (for example public_html) and controls things like redirects, HTTPS, caching and access rules.
Find and edit it
- Open cPanel, then File Manager.
- Click Settings and tick Show Hidden Files, because the name starts with a dot.
- Open your site's folder, right-click .htaccess and choose Edit.
Common uses
- Redirect old pages to new ones (see Set Up a 301 Redirect)
- Force HTTPS (see Force Your Website to Use HTTPS)
- WordPress pretty links: WordPress writes its own block between # BEGIN WordPress and # END WordPress. Add your own rules outside that block.
Be careful
A single typo can cause a "500 Internal Server Error" on the whole site. Always download a copy first, and if the site breaks, put the old copy back.
Need help? Open a support ticket or email support@anykey.sx.