.htaccess options
Tick what you need. The file builds itself on the right.
Generate a production-ready .htaccess file without memorizing Apache syntax. Force HTTPS, set up redirects, enable caching and compression, then copy or download the file. Free, instant.
Tick what you need. The file builds itself on the right.
A complete .htaccess file for Apache servers: HTTPS and www canonicalization, 301 redirects, GZIP compression, browser caching rules, hotlink protection, directory-listing lockdown, custom 404 and IP blocks. Tick the options you need and the file assembles itself with comments explaining each block.
Copy it or download it, then upload to your site root.
Always back up your existing .htaccess first: one bad rule can take a site down with a 500 error. Upload, then test the homepage, an old redirected URL and an image URL immediately.
Note: these rules are Apache-only. Nginx, Cloudflare Pages and Vercel use different config formats.