Build an .htaccess file without memorising Apache directives. Tick the rules you want, add extras, and copy the result.
Back up your existing .htaccess before replacing it, and test your site afterwards.
How to Use
- Tick the rules you want in your
.htaccessfile. - Set a custom 404 page path, or clear it to skip.
- Optionally paste extra Apache directives, one per line.
- Press Generate .htaccess.
- Press Copy and save the result as
.htaccessin your site root (back up the old file first).
Key Features
- Common rules ready-made — HTTPS forcing, www redirects, gzip, caching and more.
- Hotlink protection — optional rule blocking other sites from embedding your images.
- Extra rules box — append your own directives to the generated file.
- Commented output — every section is labelled so you can edit with confidence.
- 100% private — runs entirely in your browser; nothing is sent or stored.
FAQs
Where do I put the .htaccess file?
In the root directory of your website (often public_html). Rules apply to that folder and its subfolders.
Will this work on Nginx?
No — .htaccess is Apache-only. For Nginx, use our Nginx Config Generator instead.
What should I back up?
Download your current .htaccess before replacing it. If anything breaks, restore the backup and your site returns to normal.
Do I need the hotlink rule?
Only if other sites embed your images. Remember to replace yourdomain.com in the rule with your real domain after copying.
Is my data sent anywhere?
No. Everything runs entirely in your browser and never transmits or saves your entries.
Related Tools
Try these related tools: Port Lookup, Dockerfile Generator and Gitignore Generator.