.htaccess Redirect Generator
Generate Apache .htaccess rules for 301 or 302 page redirects, forcing HTTPS and adding or removing www, for cPanel and Hostinger hosting.
Runs on your device
Result
Results appear here after you select “Generate”.
What it does
When you rename pages or move domains, 301 redirects pass visitors and most ranking signals to the new URL. Paste "old-path new url" pairs and get mod_rewrite rules with special characters escaped.
How to use it
- List one redirect per line: /old-page/ /new-page/.
- Choose 301 or 302, plus HTTPS and www options.
- Add the rules to the top of your .htaccess and test.
Example
The example fills in realistic values and runs the tool. Select Try an example above to see it.
When it helps
- Site migrations.
- Renamed blog posts.
- Enforcing HTTPS on shared hosting.
Questions
301 or 302?
301 is permanent and should be used for moved content. 302 is temporary and tells search engines to keep the old URL.
Will this work on Nginx?
No. These rules are for Apache and LiteSpeed, which cPanel and hPanel hosting use.
More seo tools
See all 10- URL Slug Generator Turn titles into clean, lowercase URL slugs: accents removed, symbols stripped, optional stop word removal and a maximum length that never cuts a word in half.
- Robots.txt Generator Build a valid robots.txt with disallowed paths, a sitemap reference, an optional crawl delay and optional rules blocking known AI training crawlers.
- XML Sitemap Generator Create a valid sitemap.xml from a list of URLs. Duplicates are removed, URLs are XML-escaped and entries from other domains are flagged.
- Google SERP Snippet Preview Preview how a title and meta description may be truncated in Google desktop results, using an approximate pixel width model rather than plain character counts.
- Keyword Density Checker Count how often words and two- or three word phrases appear in your copy and check the density of a target keyword, to catch stuffing or missing topics.
- FAQ Schema Generator Turn questions and answers into valid FAQPage JSON-LD structured data, safely escaped for embedding in a script tag.
People also use
Browse all 200 tools- PDF to Text Extractor Extract the text from a PDF page by page and copy or download it as a .txt file. Works on digital PDFs; use OCR for scanned ones. Media & files
- IPv4 Subnet Calculator (CIDR) Calculate network address, broadcast, usable host range, subnet mask, wildcard mask and host count from any IPv4 address and CIDR prefix. Developer
- Quadratic Equation Solver Solve ax² + bx + c = 0 with full working: the formula, substituted values, discriminant and real or complex roots, step by step. Student & maths
- Sticky Notes Board Post colour coded sticky notes on a board for ideas, reminders and quick plans. Notes save automatically in your browser. Time & productivity