Htaccess Generator
Create Apache .htaccess rules without learning server syntax — enter your domain, tick the options you need, and get ready-to-use code for HTTPS redirects, www control, browser caching, GZIP and hotlink protection.
Redirects
Performance
Security
Upload this file to your website's root folder (where the index file is) with the name
.htaccess. Take a backup of the old file first — a wrong rule can take your site down. These rules only work on Apache servers, not on Nginx.
How to use
- Enter your domain and select the options you need.
- Press Generate .htaccess.
- Copy the code or download the file, and save it in your hosting root folder as
.htaccess. - Open your site and check that everything works fine.
Tips
- Back up your existing .htaccess file before uploading a new one — a wrong rule can take your site down.
- Upload the file to the folder where your index file lives, usually public_html.
- These rules work on Apache servers only, not on Nginx.
- Test one option at a time so you know which rule caused a problem.