Skip to content

Free Htaccess Redirect Generator

Generate 301 redirect rules for Apache and LiteSpeed servers, built in your browser.

Free tool

Runs in your browser. Nothing you enter is uploaded or stored.

Loading the tool...

An htaccess redirect generator writes the rules that send visitors and search engines from an old URL to a new one. The free Htaccess Redirect Generator above produces 301 redirect rules for Apache and LiteSpeed servers. It works in your browser, so the addresses you enter are not uploaded or stored.

Google recommends that you use a permanent server-side redirect whenever possible, and lists 301 and 308 as the status codes that signal a permanent move.

How to use the Htaccess Redirect Generator

  1. Make a list of old addresses and the new address each should lead to. Match each old page to its closest equivalent.
  2. Enter the old and new URLs in the generator.
  3. Generate the rules and read them through to make sure each pair is right.
  4. Back up your current .htaccess file, then add the new rules to it.
  5. Test every old address with the Redirect and Status Code Checker and confirm each gives a single 301 to the right page.

How to read the results

The output is plain text you paste into your .htaccess file. In its simplest form each rule names the old path and the new full address with a 301 status, for example Redirect 301 /old-page/ https://example.com/new-page/. Read each pair as: when someone asks for this old path, send them permanently to that new address.

  • Check the direction. The old address comes first and the new one second. Reversing them sends traffic the wrong way.
  • Check the destination. It should be the final, live URL, on the protocol and host you want indexed.
  • Check the count. You should have one rule per old page you listed.

A good set of rules is short, accurate and free of overlaps. A bad one has pairs that point at each other, destinations that themselves redirect, or paths that match more than you meant.

What to fix before and after you go live

  • Chains. If page A goes to B and B already redirects to C, point A straight to C.
  • Loops. Two rules that send traffic back and forth stop a page loading. Remove one.
  • Everything to the home page. Sending all old URLs to one page is unhelpful. Choose the closest matching page for each.
  • Rule order and conflicts. Existing rules from your CMS or a plugin may overlap with new ones. Place rules carefully and test, because a conflict can cause unexpected results.
  • Syntax slips. A stray character in the file can cause a server error on the whole site. Keep the backup ready so you can restore it at once.

Which servers this suits

The rules are meant for Apache and LiteSpeed, which both read .htaccess files. Other servers, such as Nginx, use a different configuration and do not read this file, so these rules will not work there. If you are not sure what your host runs, check your hosting panel or ask your host. On some managed platforms you may not have access to the file at all, and a plugin or a built-in redirect manager may be the better route.

A worked example

This is an illustrative example. A business renames its page from /services/seo/ to /technical-seo-services/. You enter the old and new addresses, generate one rule, add it to .htaccess, and test the old URL. The checker shows one 301 and a 200 at the new address. You then update your internal links and sitemap to use the new address directly, so visitors are not sent through the redirect at all.

Limits to know about

The generator makes rules from what you type. It does not look at your site, so it cannot tell whether the destination exists or whether a rule conflicts with the ones already in your file. A redirect is not a fix for a poor page, and it does not guarantee that rankings move across. Always test on the live site, and keep the redirects in place for a long time. If your list is large, test a handful of each type of page first.

Questions about the Htaccess Redirect Generator

Is a 301 redirect the right choice for a moved page?

Yes, when the move is permanent. A 301 tells search engines the old address has gone for good, so the new one can take its place in results. Use a temporary redirect only for short-term changes.

Will this work on Nginx?

No. Nginx does not read .htaccess files and uses its own configuration. The rules here are for Apache and LiteSpeed, so check what your host runs before you add them.

What if my site breaks after I add the rules?

Restore the backup of your .htaccess file straight away. Then add the rules back a few at a time, testing as you go, to find the line that caused the error.

Back to all free technical SEO tools or the full toolkit. If you would rather have someone check the whole site, see my technical SEO services or ask for a free audit.