SEO Utilities

Free .htaccess Redirect Generator

Build .htaccess redirect rules without memorising Apache syntax. Add old and new paths, choose 301 or 302, and optionally force HTTPS or www.

www:
RewriteEngine On

Always back up your existing .htaccess before editing - syntax errors can take a site offline.

Why redirects matter for SEO

When you move or rename a page, redirects make sure visitors and search engines land in the right place instead of hitting a 404. Crucially, a 301 (permanent) redirect passes the old page's ranking signals on to the new URL, so you keep the authority you have already earned. A 302 is temporary and tells search engines the original will return.

Forcing a single canonical hostname - HTTPS over HTTP, and either www or non-www - prevents the same content being served on multiple variants, which dilutes ranking signals and can confuse analytics.

How to use this tool

Add each old-to-new path pair and choose 301 or 302. Toggle HTTPS enforcement and pick a www preference if you want those rules included. Copy the generated block into the .htaccess file at your Apache site root.

Always back up your existing .htaccess first - a single syntax error can take a site offline. Note that .htaccess is Apache-specific; Nginx uses different configuration.

301 vs 302 redirect: which should you use?

Use a 301 for anything permanent - a moved page, a renamed URL, a site migration. It tells search engines the change is final and transfers the old URL's ranking signals to the new one. Use a 302 only when the move is genuinely temporary and the original URL will return, such as a short promo page or A/B test. Using a 302 by mistake for a permanent move is a common SEO error that stops link equity from passing.

Why your .htaccess redirect isn't working

If a redirect refuses to fire, the usual culprits are: rules placed in the wrong order (Apache reads top-to-bottom, and the first match wins), a missing RewriteEngine On line, mod_rewrite not being enabled on the server, or aggressive browser caching of an old 301 (test in a private window). Also make sure your redirect rules sit above any WordPress block in the file.

Generate clean rules below to rule out syntax mistakes, then add them near the top of your .htaccess.

After the move, keep ranking

Once your redirects preserve authority, the next step is building more of it. Soro publishes optimised content on autopilot so your site keeps gaining ground. See how.

Frequently asked questions

What is the difference between a 301 and 302 redirect?

A 301 is permanent and passes ranking signals to the new URL - use it for moved content. A 302 is temporary and tells search engines the original URL will return.

Where do I add these redirect rules?

Paste them into the .htaccess file at the root of your Apache site. Always back up the existing file first, as syntax errors can take a site offline.

Does this work on Nginx?

No - .htaccess is specific to Apache. Nginx uses a different configuration syntax, though the redirect logic (301 vs 302) is the same concept.

Why is my .htaccess redirect not working?

Common causes are rules in the wrong order (the first match wins), a missing "RewriteEngine On" line, mod_rewrite not enabled on the server, or a cached old redirect. Place your rules near the top of the file and test in a private browser window.

Related free tools

Browse all free tools