Hosting for customers worldwide, from our team in Nairobi, Kenya · Pay securely with Visa, Mastercard or M-Pesa
Free Tool
.htaccess Generator
Pick from proven, widely used rules and get a tidy .htaccess file for Apache or LiteSpeed servers.
HTTPS and redirects
Speed and caching
Security
WordPress
Using the generator
Switch on the rules you want in the left-hand panel.
Copy the file that appears on the right.
Open the .htaccess file in your site's root folder, or create one if there is none.
Paste in the rules and save the file.
Load your site to test it. If something breaks, comment out the block you added last and try again.
Before you paste
Back up first. One faulty line in .htaccess can bring the whole site down, so store the current working version somewhere safe before you edit.
Mind the order. Rewrite rules run from the top down. The HTTPS rule goes first, the www or non-www rule next, and internal rewrites last.
LiteSpeed follows nearly all Apache directives, although some Header rules have no effect on tightly restricted setups. That is why SiteBoma sends its own security headers from PHP.