localwebadvisor

Free tool

.htaccess redirect generator

Moving pages or rebuilding your site? Paste your old and new URLs and get clean 301 redirect rules for Apache — plus the nginx equivalent — with HTTPS and www canonicalization built in.

Redirect type
# Add "old-path new-path" lines above or enable an option
# to generate your .htaccess rules.

How to use

Three steps, ten seconds

  1. 01

    Paste your URL pairs

    One redirect per line: the old path, a space, then the new path — for example '/old-page /new-page'. Full URLs work as destinations too.

  2. 02

    Set your options

    Choose 301 or 302, force HTTPS, and pick a www policy so every visitor and crawler lands on one canonical version of your domain.

  3. 03

    Copy the config

    Grab the .htaccess block for Apache hosts, or flip to the nginx tab for the equivalent server rules, and paste it into your server config.

FAQ

Common questions

Should I use a 301 or a 302 redirect?

Use 301 (permanent) for almost everything — moved pages, site migrations and deleted content with a replacement. It tells Google to transfer the old page's ranking signals to the new URL. Use 302 (temporary) only when the move genuinely is temporary, like an A/B test or seasonal page, so Google keeps the original URL indexed.

Where does the .htaccess file go?

In the folder the rules should apply to — usually your site's web root (often called public_html), alongside your homepage. The filename is exactly '.htaccess' with the leading dot and no extension. It works on Apache and LiteSpeed servers; if your host runs nginx, use the nginx tab instead, since nginx ignores .htaccess files.

Do redirects hurt SEO?

Done right, they protect it. A 301 redirect passes the vast majority of link equity to the new URL. What hurts is leaving old URLs returning 404s, chaining several redirects together, or redirecting everything to your homepage instead of the closest matching page. Redirect each old URL to its most relevant replacement.

Free website audit

Want the full picture?

Tools fix one thing at a time. Our free audit checks your whole site — speed, SEO, mobile, security — and tells you exactly what is costing you customers.

Run the free 20-second scan →