301 Redirect Generator
Make .htaccess, Nginx or _redirects rules for moved pages.
Also called: 301 redirect tool, htaccess redirect generator, nginx redirect generator, 301 generator.
301 Redirect Generator
Make .htaccess, Nginx or _redirects rules for moved pages.
Watch: how to use the 301 Redirect Generator (13 seconds)
Recorded on a phone, steps written on screen, no sound. Open the video page.
About the 301 Redirect Generator
Moved or renamed pages? Write each old path and its new address on one line, and get ready-made 301 redirect rules for Apache (.htaccess), Nginx, or the _redirects file used by Cloudflare Pages and Netlify. A 301 tells browsers and Google the page has moved for good, so visitors and search rankings follow it.
Separate the old path and the new address with a space. Use paths like /old-page for the old side and a path or full URL for the new side.
Put the Apache rules in the .htaccess file in your site’s root, or the Nginx lines inside your server block, then test a few old links.
301 redirect examples and deployment checks
Enter one mapping per line: the old path first, followed by the destination. For example, /old-page /new-page. The old path must begin with a slash; the destination can be a site path or a full HTTP/HTTPS URL.
For Apache, the generated line is Redirect 301 /old-page /new-page and belongs in the appropriate .htaccess file. For Nginx, the equivalent output is rewrite ^/old-page$ /new-page permanent; and belongs in the relevant server configuration. The tool generates rules only; it does not publish them to your server.
After deployment, test the old URL and confirm it returns a permanent 301 to the intended final page. Avoid redirect chains and loops: point each retired URL directly to its closest relevant replacement, not automatically to the home page. For Cloudflare Pages and Netlify, choose the _redirects option, which writes lines like /old-page /new-page 301.
Checks the generator does for you
- Query strings. Apache
Redirectand Nginxrewriteignore the part after?, so a line like/page?id=5 /newwould never fire. The generator writes aRewriteCond %{QUERY_STRING}rule for Apache and anif ($request_uri = …)line for Nginx instead. The_redirectsformat cannot match query strings, so such lines are skipped with a note. - Loops. A line that sends a path to itself is refused.
- Chains. If a new address is itself redirected further, a comment tells you to point the first path straight to the final page.
- Prefix matches. Apache
Redirect 301 /blogalso moves/blog/post. When one old path sits inside another, a comment tells you which line to put first.
After moving pages, update your XML sitemap with the new addresses and check your robots.txt rules.
How to use the 301 Redirect Generator
- Enter your textType or paste old path and new address.
- Pick the optionsserver (the defaults suit most uses).
- Press Run toolThe result appears right under the button.
- Copy or download the resultCopy text results with Copy output; when the tool makes a picture or file, use its Download button.
This tool works inside your browser: what you enter stays on your device.
Example
A sample input and the result the 301 Redirect Generator gives for it (produced by the tool itself, not typed by hand).
- Old path and new address
- /old-page /new-page /blog/a https://example.com/news/a
- Server
- Apache (.htaccess)
Result:
Redirect 301 /old-page /new-page Redirect 301 /blog/a https://example.com/news/a
Good to know
- What you need
- You type or choose: Old path and new address
- Where it runs
- In your browser, on your device.
- Cost
- Free, no sign-up.
Read the guide
Questions
301 or 302?
301 for a permanent move (SEO value passes to the new page); 302 only for a temporary change.
Where do I put .htaccess rules?
In the .htaccess file in the folder where your website starts (often public_html).
Does Cloudflare Pages use .htaccess?
No. Choose the Cloudflare Pages / Netlify option to get _redirects lines like “/old /new 301”.
More tools in SEO & Web
- Google Search Result Preview (SERP Snippet)
- Article Schema Generator (JSON-LD)
- Breadcrumb Schema Generator (JSON-LD)
- DNS Lookup (A, MX, TXT, CNAME, NS…)
- FAQ Schema (JSON-LD) Generator
- Hreflang Tag Generator
- Keyword Combiner (Mixer)
- Keyword Density Checker
- Local Business Schema Generator (JSON-LD)
- Long-Tail Keyword Ideas Generator
- Meta Tag Generator
- On-Page SEO Checker (paste HTML)