.htaccess 301 Redirect Rule Generator
Generate clean Apache .htaccess 301 redirect rules with optional HTTPS and non-www canonical enforcement.
Inputs
Build clean Apache redirect rules for HTTPS enforcement, non-www canonicalization, and 301 page moves.
Generated .htaccess
Ready to copy or download. Runs 100% in your browser.
RewriteEngine On
# Force HTTPS and canonical apex domain
RewriteCond %{HTTPS} !=on [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.ca$ [NC]
RewriteRule ^ https://example.ca%{REQUEST_URI} [R=301,L]
# Individual 301 redirects
Redirect 301 /old-services /services
Redirect 301 /plumbing-toronto.html /areas/toronto/plumbing- Back up your existing .htaccess file before deploying changes.
Common questions
Should redesign redirects use 301 or 302?
Use 301 permanent redirects so search engines transfer ranking signals to the new destination URL.
Where should HTTPS redirect rules sit in .htaccess?
Place RewriteEngine On and HTTPS rules above CMS front-controller rewrites so requests redirect in one hop.
More generators tools
Next.js & Vercel Redirect Config Generator
Convert URL migration lists into ready-to-paste next.config.ts async redirects() or vercel.json rules.
Bulk URL Slugifier & Redirect Pair Builder
Convert lists of page titles, services, or city names into clean lowercase SEO URL slugs and optional redirect mappings.
Redirect Checker
Trace every redirect hop from an input URL to its final destination and confirm HTTP traffic redirects cleanly to HTTPS.
FAQPage JSON-LD Schema Generator
Turn question and answer pairs into clean, valid FAQPage JSON-LD ready to paste into any webpage.
Service JSON-LD Schema Generator
Generate Schema.org Service JSON-LD linking your service name, provider brand, cities served, and description.
Organization JSON-LD Schema Generator
Create clean Organization JSON-LD with your logo URL, phone number, and official sameAs social profiles.