Redirect Generator
Enter a source and destination URL to instantly generate ready-to-use 301 or 302 redirect code for Apache, Nginx, and HTML.
Redirect Settings
Quick Examples
Enter source and destination URLs, then click Generate Redirect Code to see snippets.
301 Permanent Redirect
Apache
.htaccess
Nginx
server block
HTML
meta refresh
(no server access needed)
PHP
header() redirect
Copied!
Summary
Enter a source and destination URL to instantly generate ready-to-use 301 or 302 redirect code for Apache, Nginx, and HTML.
How it works
- Enter the source URL or path you want to redirect from.
- Enter the full destination URL you want to redirect to.
- Choose redirect type: 301 (permanent) or 302 (temporary).
- The tool instantly generates snippets for Apache, Nginx, and HTML meta refresh.
- Click the copy button next to any snippet to copy it to your clipboard.
- Paste the snippet into your server configuration or HTML file.
Use cases
- Redirect old page URLs to new ones after a site restructure.
- Set up permanent 301 redirects to consolidate duplicate content for SEO.
- Create temporary 302 redirects for A/B testing or seasonal campaigns.
- Redirect an entire old domain to a new domain.
- Move a page from HTTP to HTTPS with a 301 redirect.
- Generate meta refresh HTML for shared hosting without server config access.
- Quickly prototype redirect rules before deploying to production.
- Verify correct syntax for Apache RewriteRule vs Nginx rewrite directives.
Frequently Asked Questions
Related tools
Last updated: 2026-05-29 ·
Reviewed by Nham Vu