Setting up a 301 redirect incorrectly can break your site, leak PageRank, or create infinite redirect loops. Our Safe 301 Redirect Generator removes the guesswork – just enter your old URL or path, your new destination URL, and choose the engine that suits your server setup. We’ll output a clean, tested snippet ready to paste straight into your .htaccess file.
301 Redirect Generator
How to Use
- Enter your old URL or path (e.g.,
/old-page/). - Enter the new target URL (absolute, e.g.,
https://example.com/new-page). - Choose the engine:
- Redirect 301 (mod_alias): simplest one-to-one redirect; preserves query strings.
- RedirectMatch 301: regex; good for optional trailing slash matches.
- RewriteRule (mod_rewrite): advanced flags (
NC,QSD).
- Options:
- Match trailing slash: catch both
/oldand/old/. - Case-insensitive (NC): only for RewriteRule.
- Drop incoming query (QSD): only for RewriteRule.
- Match trailing slash: catch both
- Click Generate and copy the snippet.
- Paste it at the top of
.htaccess(above WordPress rules) and test.
Notes: Backup .htaccess first. Do not place Redirect inside <IfModule mod_rewrite.c>. Use RewriteRule for dropping queries via QSD.
Why Use Our 301 Redirect Generator?
- Three engine options: Redirect 301 (mod_alias) for simple one-to-one redirects, RedirectMatch 301 for regex-based matches, and RewriteRule (mod_rewrite) for advanced setups with flags.
- Smart trailing slash handling: generate a snippet that catches both /old-page and /old-page/ with a single tick.
- Case-insensitive matching (NC flag): available for RewriteRule – useful when URLs may arrive with mixed capitalisation.
- Drop query strings (QSD flag): strip incoming query parameters so ?utm_source=newsletter doesn’t follow visitors to the new URL (RewriteRule / Apache 2.4+ only).
- Instant validation: catches missing fields, invalid URLs, and flags when an option isn’t compatible with the chosen engine.
- Copy-to-clipboard button: paste into .htaccess without manual selection errors.
- No sign-up, no data stored, completely free.
Our 301 Redirect Generator is perfect for:
- Web developers and SEOs migrating pages, restructuring site architecture, or consolidating duplicate URLs.
- Site owners who have changed their permalink structure and need to redirect old URLs to new ones.
- Agencies managing multiple client sites who need quick, consistent redirect snippets without hand-coding.
- Anyone switching from HTTP to HTTPS or changing their domain name.
- Developers who want a double-check on redirect syntax before touching a live .htaccess file.
How to Use the 301 Redirect Generator:
- Enter the source (old) URL or path – either a full URL like https://example.com/old-page/ or a path like /old-page/. The tool extracts the path automatically.
- Enter the target (new) URL – this must be a full absolute URL (http or https).
- Choose your engine: Redirect 301 for simple redirects, RedirectMatch 301 if you need a regex pattern, or RewriteRule if you need advanced flags.
- Tick any options that apply: trailing slash matching, case-insensitivity, or query string dropping.
- Click Generate. Review any warnings (some options only apply to specific engines).
- Copy the snippet and paste it at the top of your .htaccess file, above the WordPress rewrite rules.
A 301 redirect tells browsers and search engines that a page has permanently moved. Done correctly, it preserves your existing search rankings, fixes broken links, and ensures visitors always land where they’re supposed to. Done incorrectly – or skipped entirely – it can result in 404 errors, lost SEO equity, and a poor user experience. Use this tool to get it right first time.
Frequently Asked Questions
What is a 301 redirect and why does it matter for SEO?
A 301 redirect is an HTTP status code that tells browsers and search engines a URL has permanently moved to a new location. It’s the correct redirect type for SEO purposes because it passes the vast majority of link equity (often called “link juice”) from the old URL to the new one. Using a 302 (temporary redirect) when you mean to permanently redirect will not pass link equity in the same way. If you’re migrating pages, restructuring URLs, or consolidating content, 301 redirects are essential for preserving your search rankings.
What’s the difference between Redirect 301, RedirectMatch, and RewriteRule?
All three achieve a 301 redirect, but they use different Apache modules and have different capabilities. Redirect 301 (mod_alias) is the simplest – it matches exact paths and is perfect for one-to-one redirects. RedirectMatch 301 also uses mod_alias but accepts regex patterns, so you can match more flexible URL patterns. RewriteRule (mod_rewrite) is the most powerful option – it supports advanced flags like NC (case-insensitive), QSD (drop query strings), and can handle complex conditional logic. For most simple redirects, Redirect 301 is all you need.
Where do I put the redirect snippet in .htaccess?
Place the redirect snippet at the very top of your .htaccess file, before the WordPress rewrite block (which starts with # BEGIN WordPress). This ensures redirects are processed before WordPress’s own routing rules. Important: do not wrap Redirect or RedirectMatch directives inside an <IfModule mod_rewrite.c> block – that block is for mod_rewrite directives only. Always back up your .htaccess file before making changes.
Does a 301 redirect affect page load speed?
A single redirect adds a small amount of latency (typically 50–300ms depending on server response time) because the browser must make two requests instead of one. For SEO purposes, this is acceptable and expected. What you want to avoid is redirect chains – where A redirects to B which redirects to C – as these compound the delay and can dilute link equity. Always redirect directly from the old URL to the final destination.
What is the QSD flag and when should I use it?
QSD stands for “Query String Discard” and is a RewriteRule flag (Apache 2.4 and later). When enabled, any query string on the incoming request (e.g., ?utm_source=newsletter&campaign=spring) is stripped before the redirect is executed, so the user lands at the clean target URL without the query parameters. This is useful when migrating pages with UTM-tagged URLs, or when old query strings on the source URL should not be carried over to the destination. It is not available with Redirect 301 or RedirectMatch – use RewriteRule if you need it.
