htaccess redirect generator
Built in your browser · nothing is uploaded
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
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.