Force HTTPS only
With Force HTTPS on and www left as-is, the generated file adds "RewriteCond %{HTTPS} off" followed by a rule that 301-redirects every request to https://.
Generate an .htaccess file for HTTPS, www and custom redirects — free Apache generator.
About
Builds a ready-to-use Apache .htaccess file from a few common choices, like forcing HTTPS, www redirects and custom redirects.
Site owners moving to HTTPS use it to force every visitor onto a secure connection, while developers migrating old URLs use the custom redirects to send visitors from an old path straight to its replacement. It joins Toolapt's other free SEO tools, all usable without signing up and without any limit on repeat use.
Examples
4 worked examples
With Force HTTPS on and www left as-is, the generated file adds "RewriteCond %{HTTPS} off" followed by a rule that 301-redirects every request to https://.
With Force HTTPS on and www handling set to "Redirect to www", the output has 2 rewrite rules: HTTPS is enforced first, then www.example.com is made canonical.
Enter "/old-page.html /new-page.html" as a custom redirect to get a "Redirect 301 /old-page.html /new-page.html" line — one such line is added per redirect entered.
Enter "404 /404.html" and "500 /500.html" as custom error pages to get "ErrorDocument 404 /404.html" and "ErrorDocument 500 /500.html" appended — one line per status code entered.
FAQ
Quick answers to common questions about the .htaccess Generator.
It builds a ready-to-use Apache .htaccess file from your choices about HTTPS, www handling, custom redirects and custom error pages.
Yes. It's free, with no sign-up, no watermark and no limit on how many times you use it.
Yes. The file is generated entirely on your own device — nothing you enter is sent to a server.
Upload it to the root directory of your Apache-hosted site (or the directory you want the rules to apply to). It has no effect on servers that don't run Apache with mod_rewrite enabled.
One per line, as "/old-path /new-path" — an old path, a space, then the new path it should redirect to.
Yes. Add one line per status code, as "500 /500.html" — any HTTP status code works, such as 400, 401, 403, 404 or 500.
No. .htaccess files are an Apache-specific mechanism; servers like Nginx use a different configuration format and won't read this file at all.
Yes. The page is fully responsive and works on mobile, tablet and desktop browsers alike.
It covers the most common rules — HTTPS, www handling, simple redirects and custom error pages — rather than every possible mod_rewrite directive; advanced rules still need to be added by hand.
Did .htaccess Generator work for you?