How to Edit Your .htaccess File
.htaccess controls redirects, caching, security and URL rules. It is powerful — and a single bad line causes a 500 error — so edit it carefully.
Step-by-step
- Open Files → File Manager and click Settings → tick "Show Hidden Files (dotfiles)" → Save.
- Go to public_html and locate .htaccess (create a new file named .htaccess if none exists).
- Back it up first — right-click → Copy to .htaccess-backup.
- Right-click → Edit to open it.
- Add or change rules — e.g. redirects, Gzip, or caching — keeping each directive on its own line.
- Save and test immediately. If you get a 500 error, restore the backup.
💡 Good to know
- Always keep a known-good backup before editing — recovery is then instant.
- WordPress regenerates its core .htaccess rules when you re-save Permalinks.
- Order matters in .htaccess — redirect and rewrite rules are processed top to bottom.