Redirect Rule Generator

Generate .htaccess and nginx redirect rules for 301 redirects, HTTPS, and www canonicalization.

2 redirects configured

Apache .htaccess (RewriteRule)
RewriteEngine On RewriteRule ^old-page/?$ /new-page [R=301,L] RewriteRule ^blog/old-post/?$ /blog/new-post [R=301,L]
Nginx (return 301)
# Add inside your server { } block location = /old-page { return 301 /new-page; } location = /blog/old-post { return 301 /blog/new-post; }

About this tool

301 redirects preserve SEO value during URL changes, HTTPS migrations, and www canonicalization.

Generate Apache .htaccess or nginx snippets — paste into server config manually.

How to use the Redirect Rule Generator

  1. 1

    Select redirect type: 301, HTTPS force, or www/non-www.

  2. 2

    Enter source and destination URLs or patterns.

  3. 3

    Copy the generated .htaccess or nginx config snippet.

Redirect priorities

HTTPS and www/non-www should redirect in one hop — avoid redirect chains.

Test redirects with curl or browser dev tools after deployment.

Pro tips

  • Backup existing .htaccess before overwriting.
  • Map old URLs in a spreadsheet before generating bulk redirect rules.

Social Media Specs & Character Limits

Optimal text formatting, length guidelines, and parameters for all major platforms:

PlatformMax LengthIdeal LengthHashtag Policy
Instagram Feed & Reels2,200 chars125 - 150 chars3 - 5 tags (Recomm.)
TikTok Posts4,000 chars100 - 200 chars3 - 5 tags (Ideal)
YouTube Description5,000 chars1,500 chars (SEO)3 - 10 tags
X / Twitter Post280 chars100 - 140 chars1 - 2 tags
LinkedIn Articles & Posts3,000 chars500 - 1,000 chars3 - 5 tags

Related tools

All tools →

Frequently Asked Questions

Should I use 301 or 302 redirects?

Use 301 for permanent moves (domain changes, URL restructures) — it passes most SEO value.

Does this modify my server?

No. This generates config text — you paste it into your server config manually.