Redirect Generator
Free online redirect generator tool, no installation required
About Redirect Generator
Produces redirect snippets for a source URL to a destination URL across five styles: Apache .htaccess 301/302/307, the same code via mod_rewrite, nginx location + return, HTML meta refresh, and JavaScript window.location. Pick the redirect type and source/destination, then copy the generated code.
How to Use
1. Enter a Source URL (e.g. /old-path) and a Destination URL (e.g. https://example.com/new-path) 2. Choose a Redirect Type from the dropdown: Permanent 301, Temporary 302, Temporary 307, Meta Refresh, or JavaScript 3. Click Generate to produce the snippet in the Output card 4. Click Copy to copy the code, or Clear to reset the form
Generated Output by Type
301/302/307 produce a combined snippet with Apache Redirect, mod_rewrite RewriteRule, nginx location + return, plus meta-refresh and JavaScript fallbacks. Meta Refresh emits a full HTML document with the meta tag, a JS fallback, and a noscript link. JavaScript emits window.location.href, window.location.replace, a setTimeout variant, and a try/catch fallback. Note: 301/302/307 outputs all include the same meta-refresh and JavaScript fallback blocks regardless of the chosen server type.
▶Are the source and destination URLs validated?
▶Why do the 301, 302, and 307 outputs look so similar?
▶Is the generated .htaccess safe to deploy as-is?
▶What's the difference between 302 and 307?
If this tool has been helpful to you, consider buying me a coffee.
Buy me a coffee