Generate clean, ready-to-paste Apache .htaccess redirect rules β single 301 or 302 redirects in bulk, www to non-www, HTTP to HTTPS, and trailing-slash enforcement. Pick a tab, fill in the fields, and copy or download the rules. 100% in your browser β nothing is uploaded or stored.
Redirect specific old URLs to new ones. Enter one redirect per line as /old-path /new-path (paths or full URLs). A 301 is permanent and passes ranking signals; a 302 is temporary.
Force a single canonical hostname so www and non-www do not split your ranking signals. Enter your domain without the protocol.
Redirect every insecure HTTP request to HTTPS. This rule works on most shared hosts and preserves the requested path and query string.
Enforce a consistent trailing-slash style so each page has one canonical URL. Rules skip real files and directories so they do not break existing resources.
.htaccess before editing. Place redirect rules near the top of the file. These rules require Apache with mod_rewrite enabled β most shared hosts have it on by default. Test on a staging copy if you can.π Everything runs in your browser. Nothing you enter is uploaded, logged or stored.
The .htaccess Redirect Generator writes correct Apache redirect rules for you, so you do not have to memorise mod_rewrite syntax or risk a typo that takes your site offline. It covers the four redirects nearly every site needs: pointing old URLs to new ones with a 301 or 302, forcing a single canonical hostname between www and non-www, pushing all traffic to secure HTTPS, and enforcing a consistent trailing-slash style. Each rule is generated as a clean, commented block you can copy straight into your .htaccess file or download ready to upload.
It is part of the Crawl & Indexing group in our free SEO Toolkit. Pair it with the Robots.txt Generator and Robots.txt Tester to control crawling, the XML Sitemap Generator to map your live URLs, the Redirect Chain Visualizer to spot redirect loops, and the URL Slug Generator to design clean new paths. Everything runs in your browser β nothing you enter is uploaded or stored.
The redirects every site needs, generated cleanly.
Map old URLs to new ones in bulk, one per line.
Force www or non-www so signals do not split.
Send every insecure request to the secure version.
Rules are built in your browser β nothing leaves your device.
From a few fields to ready-to-paste rules.
Choose the redirect tab you need.
Enter URLs, domain or options.
Get clean, commented rules.
Paste into your .htaccess file.
The exact output for redirecting all HTTP traffic to HTTPS.
# Force HTTPS on all requests <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] </IfModule>
An .htaccess redirect generator builds the configuration rules that tell an Apache web server to send visitors and search engines from one URL to another. The .htaccess file is a per-directory control file that Apache reads on every request, and its mod_rewrite module is the standard way to implement redirects without touching your application code. The syntax is powerful but unforgiving β a stray character can return a 500 error and take the whole site down β so generating tested, correctly formatted rules removes the biggest risk. This tool produces clean, commented blocks for the redirects almost every website needs. It is part of the Crawl & Indexing group in the SEO Toolkit.
Most redirect work falls into four jobs. Single and bulk URL redirects move old pages to new ones β essential during a redesign or content reorganisation so you keep the ranking value of the old URLs. Canonical hostname rules pick either www or non-www as your one true domain, preventing search engines from treating the two as separate, competing sites. Force HTTPS sends every insecure request to the secure version, which is now expected for trust and ranking. Trailing-slash rules enforce one URL style so a page is not reachable at two addresses.
301 is permanent and passes ranking signals; 302 is temporary.
Consolidate www and non-www into a single canonical domain.
Force HTTPS so no visitor lands on an insecure page.
One URL per page avoids duplicate-content confusion.
When you move or rename a page, a 301 permanent redirect is the single most important SEO action you can take. It tells search engines the page has moved for good and instructs them to transfer the old URL's accumulated ranking signals to the new one. Skip the redirect and you get a 404, the old rankings evaporate, and any links pointing at the old URL are wasted. Use a 302 only when the move is genuinely temporary, because a 302 does not reliably pass ranking value. When migrating many URLs, redirect each old URL to its closest matching new page rather than dumping everything on the homepage, which search engines may treat as a soft 404.
Add them to the .htaccess file in your site's root directory, near the top and above any existing rewrite rules such as a WordPress block. Always download or copy a backup of the current file first. If the file does not exist you can create one, but make sure your hosting allows .htaccess overrides β most shared Apache hosts do.
A 301 is a permanent redirect: it tells browsers and search engines the move is final and transfers the old URL's ranking signals to the new one. A 302 is temporary and does not reliably pass ranking value, so reserve it for short-term changes like a sale page or maintenance. For migrations and renamed pages, almost always choose 301.
They are written for Apache with the mod_rewrite module, which powers most shared hosting. The IfModule wrapper means the block is simply ignored if the module is missing, rather than causing an error. They will not work on Nginx, which uses a different configuration syntax, so check which server your host runs if you are unsure.
No. The rules are assembled entirely in your browser with JavaScript, and the tool never makes a network request with your URLs or domain. Nothing you type is uploaded, logged or stored, so it is safe to use with unreleased domains and confidential client projects.
Map every old URL to its new home with 301s.
Force secure connections after installing an SSL certificate.
Settle on www or non-www across the whole site.
Enforce one trailing-slash style site-wide.
Use the .htaccess Redirect Generator with these tools from the SEO Toolkit: control crawling with the Robots.txt Generator and test it with the Robots.txt Tester, map live URLs with the XML Sitemap Generator, find loops with the Redirect Chain Visualizer, design clean new paths with the URL Slug Generator, set page-level directives with the X-Robots-Tag Generator, and inspect URLs with the URL Parser.
Anyone managing URLs on an Apache server.
Everything about .htaccess redirects.
It builds correctly formatted Apache redirect rules for you to paste into your .htaccess file. It covers single and bulk 301 or 302 URL redirects, www to non-www canonicalisation, forcing HTTPS, and trailing-slash enforcement, each generated as a clean, commented block you can copy or download.
Yes, completely. There is no cost, no sign-up and no limit on how many rules you generate. The tool works entirely in your browser, so there are no server costs and nothing to pay for.
A 301 is a permanent redirect that tells search engines a page has moved for good and transfers its ranking signals to the new URL. A 302 is temporary and does not reliably pass ranking value. For migrations and renamed pages choose 301; reserve 302 for genuinely short-term changes.
Paste them into the .htaccess file in your website's root directory, near the top and above any existing rewrite blocks such as the default WordPress rules. Always back up the current file first, because a syntax error in .htaccess can return a server error until it is fixed.
They are written for Apache servers with the mod_rewrite module, which powers most shared hosting. The IfModule wrapper means the block is safely ignored if the module is unavailable. They do not work on Nginx, which uses a completely different configuration syntax, so check which server your host runs.
Either works for SEO β what matters is picking one and redirecting the other to it consistently, so search engines see a single canonical site rather than two competing versions. Choose whichever matches your brand and existing links, then apply the redirect across the whole domain.
HTTPS encrypts traffic between visitors and your site, which browsers now expect and flag when missing, and it is a lightweight ranking signal. Forcing HTTPS ensures no one lands on an insecure version of a page. You need a valid SSL certificate installed first, which most hosts provide free.
No. The generated rules include conditions that skip real files and directories, so requests for images, scripts, stylesheets and existing folders are left untouched. Only page-style URLs are normalised to your chosen slash style, which avoids the same page being reachable at two different addresses.
Yes. On the single and bulk tab, enter one redirect per line as the old path followed by the new path or URL. The generator turns each line into its own rule with your chosen 301 or 302 status, which is ideal for migrating a batch of renamed pages in one go.
No. The rules are assembled entirely in your browser with JavaScript, and the tool never sends your URLs or domain over the network. Nothing you type is uploaded, logged or stored, so it is safe to use with unreleased domains and confidential client work.
Yes. The generator is fully responsive, so you can build and copy redirect rules from a phone or tablet. The tabs, input fields, generated output and the copy and download buttons all work the same on small screens as they do on desktop.
Convert, compress, and resize images in multiple formats β JPG, PNG, WebP, ICO, and more.
Calculate in-hand salary, CTC breakup, tax deductions, and more for Indian employees.
Convert length, weight, temperature, speed, volume, and 200+ measurement units instantly.
Count words, convert case, generate lorem ipsum, find & replace text, and more writing utilities.
Build correct 301 and 302 redirects, www and HTTPS canonicalisation, and trailing-slash rules β then copy or download a ready-to-use .htaccess. Free, private and instant in your browser.
π Open the Generator β All Crawl & Indexing Tools