iLoveMyFile

.htaccess Generator

Build an .htaccess file for common jobs: force HTTPS, fix www, redirect old pages, speed up loading.

Tick the options you need and the file appears below.

How to use the .htaccess Generator

  1. Tick the options you want and add any redirects.
  2. Download a copy of your site's current .htaccess file as a backup.
  3. Add the generated lines to that file (or upload the new one, renamed to .htaccess) in your site's top folder, then check that the site still loads.

Use it with care

The .htaccess file controls how an Apache or LiteSpeed server answers every request. That makes it powerful for SEO — redirects, HTTPS and speed are all set here — and also unforgiving: a single wrong line shows visitors an error page. Always keep a backup of the working file, change one thing at a time, and test straight away. If your site already has an .htaccess file (WordPress always does), add these lines to it rather than replacing it.

Frequently asked questions

Does this work on my hosting?

It works on Apache and LiteSpeed, which most shared hosting uses. It has no effect on Nginx servers.

Why is the download called htaccess.txt?

Many computers hide or refuse files whose names start with a dot. After uploading, rename it to exactly .htaccess.

Why 301 redirects?

A 301 tells search engines the move is permanent, so the old page's ranking is passed to the new address.

My site shows a 500 error after uploading.

Restore your backup. The usual causes are a server module that is not installed or a clash with rules already in the file.

Is what I type sent to a server?

No. This tool runs entirely in your browser, so nothing you enter leaves your device.