Htaccess Redirect Generator
Site-wide rules
Page redirects
One per line: the old path, a space or comma, then the new path or full URL.
Your .htaccess rules
Getting a redirect to actually fire
Apache reads .htaccess from the top and stops at the first matching rule that carries the L flag. That single fact explains most redirects that "do not work": a broad rule sitting above a specific one silently swallows it. The rules here are ordered specific-first for that reason.
Choosing the status code
- 301 — moved for good. Passes ranking, and browsers cache it hard.
- 302 — moved for now. The old URL stays indexed.
- 410 — gone, with nothing replacing it. Clearer to search engines than a 404, and it drops out of the index faster.
Mistakes worth avoiding
- Chains — A to B to C. Point A straight at C.
- Loops — a page redirecting to itself, often from a trailing-slash rule fighting an HTTPS rule.
- Everything to the home page — Google treats a mass redirect to the root as a soft 404. Send each page to its closest match, or let it 410.
Share this tool with friends
Free to use, no sign-up, works on any phone.
Frequently Asked Questions
A 301 is permanent and passes ranking to the new URL, so use it for a page that has genuinely moved. A 302 is temporary and keeps the old URL indexed — right for a seasonal page or a page down for maintenance, wrong for a move.
Apache reads them top to bottom and the first match with an L flag wins. A broad rule placed first swallows everything below it, which is the single commonest reason a redirect "does not work". Specific rules go first here for exactly that reason.
You can, but do not. Each hop loses a little ranking signal and adds a round trip, and Google gives up after about five. If A moved to B and B later moved to C, change A to point straight at C.
RewriteRule cannot see the query string, so it needs a RewriteCond on %{QUERY_STRING} — the generator writes that for you when your source URL contains a question mark.
No. This is Apache syntax, which also covers LiteSpeed and most shared cPanel hosting. Nginx uses a different configuration and does not read .htaccess at all.
Check the status code, not just the page. A correct move returns 301 on the first request and 200 on the destination. A browser caches a 301 aggressively, so test in a private window or with curl.