301 Redirect Generator (.htaccess & Nginx)
Paste your old and new URLs and instantly generate clean 301 redirect rules for Apache .htaccess and Nginx — perfect for site migrations without losing rankings.
Separate old path and new URL with a space or tab. Old paths should be relative (/old), new URLs can be absolute or relative.
How it works
Paste your URL pairs
One redirect per line: old path on the left, new URL on the right, separated by a space.
Choose your server
Switch between Apache .htaccess and Nginx config format with one click.
Copy and paste
Drop the generated rules into your config file, save, and verify the redirects are working.
Frequently asked questions
When should I use a 301 instead of a 302?
Use 301 (permanent) for any long-term move — page renames, site migrations, or removing /index.html suffixes. Use 302 only when the redirect is genuinely temporary, such as during A/B testing or maintenance windows.
Will 301 redirects pass link equity?
Yes. Google passes most of the link equity from the old URL to the new one through a 301. Redirect chains (A→B→C) reduce that transfer, so it is worth keeping chains to a single hop.
What format should old paths be in?
Old paths should be relative, starting with a slash — for example /old-page or /blog/2023/post-title. New URLs can be absolute (https://...) or relative.
Do I need to restart my server after adding .htaccess rules?
Apache reads .htaccess files on every request, so no restart is needed. Nginx config changes require a reload (nginx -s reload or sudo systemctl reload nginx).
Built by 1MarketingTool
A free utility from the team behind 1MarketingTool — a local-first desktop app for rank tracking, keyword research, AI content and AI search optimization. BYOK, zero cloud.