Free URL Redirect Generator

Generate 301/302 redirect rules for Apache, Nginx, PHP, or HTML meta refresh. Free, instant.

4.6on G2
4.8on Trustpilot
Used by 25,000+ marketers

What this tool does

URL Redirect Generator delivers fast, reliable results for generate 301/302 redirect rules for apache, nginx, php, or html meta refresh. fr.

Designed to fit into your existing SEO and content workflow with no setup overhead.

How to use the URL Redirect Generator

Five steps.

1

Enter the old and new URLs

Paste the source URL (the one being redirected from) and the destination URL (where users land instead).

2

Pick the output type

Select Apache htaccess, Nginx, PHP, or HTML meta refresh based on your hosting platform.

3

Choose 301 or 302 status code

Use 301 for permanent moves to transfer link equity; 302 for temporary redirects like A/B tests.

4

Copy the generated rule into your config

Paste into htaccess, nginx.conf, a PHP file, or an HTML page as appropriate.

5

Test with curl and Search Console

Run curl -I https://yourdomain.com/old-url to confirm 301 status and Location header. Submit via Search Console URL Inspection.

When teams use it

Six common workflows.

Site migration redirect map

Generate hundreds of 301 redirects for a domain change or URL restructure. Preserve link equity and prevent 404 floods.

HTTPS and www canonicalization

Force HTTPS and consolidate www/non-www into a single canonical with one 301 hop. Standard launch checklist item.

Blog post slug refresh

When updating evergreen posts, change slugs to reflect new keyword targets and 301 the old slugs to maintain rankings.

A/B test traffic split (302)

Use temporary 302 redirects to split traffic between variants without consolidating ranking signals onto either URL.

Removing low-quality pages

When pruning thin content, 301-redirect each removed URL to its most relevant remaining page rather than letting it return 404.

Multi-region site routing

Geo-redirect users to regional subdomains (us.example.com, uk.example.com) with proper hreflang and 302 status.

Platform guides

Integrate with major platforms.

Apache (htaccess)

  1. Open or create .htaccess in your document root.
  2. Add RewriteEngine On at the top, then your Redirect or RewriteRule directives.
  3. Save and test with curl -I https://yoursite.com/old-url.
  4. If you see a 500 error, comment out recent edits and validate syntax with apachectl configtest.

Nginx

  1. Edit /etc/nginx/sites-available/yourdomain.conf or your main nginx.conf.
  2. Add return 301 statements inside server { } blocks; for patterns, use location ~ regex syntax.
  3. Run nginx -t to validate syntax, then nginx -s reload to apply without downtime.
  4. Verify with curl -I against the live domain.

PHP

  1. Create or edit the PHP file that should redirect.
  2. Paste the generated header() redirect before any output is sent.
  3. Choose 301 for permanent moves or 302 for temporary redirects.
  4. Open the old URL and confirm it lands on the destination.

HTML meta refresh

  1. Use HTML meta refresh only when server-side redirects are not available.
  2. Paste the generated meta tag into the head of the old HTML page.
  3. Keep the delay at zero for an immediate redirect.
  4. Test in a browser and confirm the destination URL loads.

Grigora vs. alternatives

Side-by-side.

CapabilityGrigoraTool ATool BTool CTool D
htaccess outputYesYesYesYesManual
Nginx config outputYesYesNoYesManual
PHP redirect outputYesNoNoYesNo
HTML meta refresh outputYesNoNoNoManual
301 vs 302 toggleYesLimitedNoYesManual
Bulk URL list inputNoPaidNoPaidNo
Free with no signupYesYesYesTrialYes
Chain detection warningNoNoNoPaidNo

Common errors and fixes

Eight issues users hit.

Redirect loop (URL redirects to itself)

Cause: Misconfigured rule causes /a to redirect to /a, often from missing exception conditions on htaccess RewriteRules.

Fix: Add RewriteCond to skip rule when source equals destination. Test with curl -I -L --max-redirs 5 to detect loops.

Redirect chain with 3+ hops

Cause: HTTPS, www, and trailing-slash rules stacked sequentially without consolidating into a single redirect.

Fix: Combine rules into one rewrite that handles all canonical changes in a single 301. Audit chains via Screaming Frog.

302 used for a permanent move

Cause: Default redirect type chosen at platform level (Vercel permanent: false, Netlify default 302) without overriding.

Fix: Explicitly set 301 status. In Vercel: permanent: true. In Netlify: append 301 to _redirects line.

Redirect points to 404 destination

Cause: New URL was deleted or never existed; redirect map was generated from outdated sitemap.

Fix: Audit destinations with a tool like httpstatus.io. Update mapping to a live URL or remove the redirect.

htaccess syntax error returns 500

Cause: Missing closing tag, incorrect flag, or unsupported directive crashes Apache config parsing.

Fix: Comment out recent edits and test incrementally. Validate syntax with apachectl configtest before deploy.

Redirects do not apply (rule never triggers)

Cause: Rule order conflict — another redirect or routing rule matches first and bypasses the new rule.

Fix: Move new rule above conflicting rules. In Apache use [L] flag to stop further processing once matched.

Query string lost on redirect

Cause: htaccess RewriteRule by default discards query string when destination contains its own query.

Fix: Add [QSA] flag (Query String Append) or [QSD] (Query String Discard) explicitly. Test with ?utm tags.

Redirects work locally but fail in production

Cause: Edge cache, CDN, or load balancer overrides server redirects; or production runs different web server software.

Fix: Move redirects up to the CDN/edge layer (Cloudflare Page Rules, Vercel redirects, Cloudfront behavior).

Original data

2026 study.

95-100%
Link equity passed by 301 redirect
4-12 weeks
Time for full equity transfer
5-15%
Equity loss per chain hop
5
Max redirect hops Google follows

Frequently asked questions

Twelve answers.

Related free tools

Other utilities.

Try URL Redirect Generator now

Free, unlimited, no signup.

Try the Tool