Free tools, SEO and marketing

.htaccess redirect generator

Tick the rules you need, add old and new addresses, and copy the result into .htaccess.

One per line: old path, a space, new path or full URL.

Questions

My site is behind Cloudflare. Will "force HTTPS" cause a loop?

It can, if Cloudflare connects to your server over plain HTTP ("Flexible" SSL). Turn on the "Behind Cloudflare" option: the rule then reads the visitor’s real scheme from the CF-Visitor header. Better still, enable Always Use HTTPS in Cloudflare and skip the rule.

Where do I put these rules?

In the .htaccess file in your site’s root folder, above any existing WordPress block (# BEGIN WordPress). Keep a copy of the old file: one typo in .htaccess makes the whole site show a 500 error.

Does this work on nginx?

No. .htaccess is only read by Apache and LiteSpeed. On nginx the same redirects are written in the server block with return 301.

More seo and marketing tools

All 55 free tools