.htaccess generator
Tick what you need and copy a ready .htaccess. Covers the rules people search for most: HTTPS, www, redirects and caching.
Runs entirely in your browser — nothing you enter is sent to our servers.
Works on Apache and LiteSpeed. nginx ignores .htaccess — put equivalent rules into the server block.
How it works
The generated file uses mod_rewrite for HTTPS and www redirects, Redirect 301 for moved pages, mod_expires and mod_deflate for caching and compression, and Require for access rules — all standard on Apache 2.4 and LiteSpeed. Blocks are wrapped in IfModule where a missing module would otherwise cause a 500 error. nginx ignores .htaccess entirely: there the same rules go into the server block.
FAQ
Will this work on nginx?
No, nginx doesn't read .htaccess. Use return 301 and location blocks in the server config instead.
I got a 500 error after uploading
Usually a module isn't enabled (rewrite, expires, headers) or AllowOverride is off. Check the Apache error log — it names the exact line.
Related tools
All tools →Put it to use on your own server: KVM VPS from $3/month, root access, crypto payments.
VPS plans