TOOLTIKI Lovable tool, really free
SEO & web Site files

htaccess redirect generator

Built in your browser · nothing is uploaded

Local · a mistaken 301 is cached indefinitely
Advertisement
320 × 100

Generates Apache RewriteRule lines for a list of redirects. 301 for a permanent move, 302 when the old URL will come back.

How to use the htaccess redirect generator

1 Fill in the fields. Empty ones are left out rather than emitted blank.
2 Copy the result.
3 Paste it into your page and check it with Google’s Rich Results Test before relying on it.

Choosing the wrong code has consequences that are hard to undo. A 301 is cached aggressively by browsers — often indefinitely — so a mistakenly permanent redirect keeps sending returning visitors to the wrong place long after you fix the server, and the only remedy is asking them to clear their cache. Use 302 whenever there is any chance of reverting. The 307 and 308 variants exist because 301 and 302 historically allowed a client to change a POST into a GET; the newer codes forbid that, which matters for anything redirecting a form submission. Chains are the other thing to watch: redirecting A to B and later B to C means two hops, and consolidating them into one is worth doing.

Questions

301 for a permanent move. 302 if there is any chance of reverting — a 301 is cached by browsers, often indefinitely.

Apache — mod_rewrite
Advertisement
300 × 250
Was this tool any good?
INTERNAL SIGNAL ONLY · WE USE IT TO FIND TOOLS WORTH REBUILDING