.htaccess Redirect Generator

Write redirect rules without remembering the syntax. They are built in your browser and apply to Apache servers.

Your files stay with you. Your files never leave your browser. This tool runs on your device: nothing is uploaded to our servers, so there is nothing for us to store or see.

How to use it

  1. List old and new paths, one pair per line.
  2. Choose the redirect type and any site-wide rules.
  3. Back up your current .htaccess, then add the generated rules at the top.

Where it helps

Website redesigns

Send old page addresses to their new equivalents.

Moving to HTTPS

Make sure every visit uses the secure version.

Domain tidy-up

Choose www or non-www and redirect the other.

Good to know

  • Stays in your browser

    What you type is processed on your device and never sent to our servers.

  • Back up first

    A wrong rule can cause a loop or a server error.

  • Test every rule

    Use the HTTP status checker after uploading.

  • Order matters

    Put the generated rules at the top of the file.

Questions people ask

How do you redirect old pages with .htaccess?

List old and new paths, one pair per line, choose the redirect type and any site-wide rules such as forcing HTTPS or www, then add the generated rules at the top of your .htaccess file. Back up the current file first. These rules work on Apache servers, including most cPanel hosting, not on Nginx.

  • 301 Permanent. Passes the old address on.
  • HTTPS Force secure. And www or non-www.
  • Apache Where it works. Not Nginx.
  • 0 Data sent. In your browser.
What is a .htaccess redirect?
It's a rule in the .htaccess file on an Apache web server that sends visitors and search engines from one address to another automatically. Redirects keep old links working after you move or rename pages, and pass search rankings to the new addresses. Visitors never notice it.
Will this work on my host?
It works on Apache servers, which includes most shared hosting and cPanel hosting, when .htaccess files are enabled. It doesn't work on Nginx, where rules go in the server configuration instead. If you're unsure which server you have, ask your hosting support. Support teams can confirm quickly.
301 or 302?
Use 301, permanent, when a page has moved for good, so search engines transfer the old address's signals to the new one. Use 302 or 307 for short-term moves, such as a temporary maintenance page. Most redesign redirects should be 301. When unsure, use 301.
What's the difference between the two matching modes?
Exact match changes only the page you list. The simple Redirect directive also catches every address that starts with that path, so redirecting /blog could also redirect /blog/anything. Use exact match unless you deliberately want a whole section moved. Test both carefully. Exact match is safer.
Can a wrong rule break my site?
Yes. A mistake can cause a redirect loop or a server error that takes the site offline. Keep a copy of the old file, add the rules, and test every redirect straight away. If something breaks, restore the backup and check the rules again. Backups make it safe.
How do I force HTTPS?
Tick the force HTTPS option, and the generator adds a rule sending every http:// visit to https://. Make sure your SSL certificate is installed first, or visitors will see security warnings. Most hosts provide free certificates through Let's Encrypt. Test both versions afterwards. Then test both versions.
Should I use www or non-www?
Either is fine; what matters is choosing one and redirecting the other to it, so search engines don't see two copies of your site. Pick whichever your business already uses on printed material and in your Google profile. Search Console tracks either one. Use one everywhere.
Where do I put the rules?
At the top of the .htaccess file in your website's root folder, before other rules such as those added by WordPress. Use your hosting control panel's file manager or FTP to edit it. Always download a backup copy before saving changes. Save, then test. Test each redirect afterwards.
Is anything I type sent to your server?
No. The rules are built in your browser, so your page paths stay on your device. You copy the rules and add them to your own server; nothing is changed on your website until you upload the edited file. No account is needed. No account is needed.
How do I test my redirects?
Use the HTTP status checker to follow each old address and confirm it returns a 301 and lands on the right page in one hop. Also open a few old links in a private browser window, which avoids cached redirects from earlier visits. Fix chains you find.
What is a redirect chain?
A chain is when one address redirects to another, which redirects again, and so on. Chains slow visitors down and can lose search signals. Point each old address directly to its final destination, and update any older redirects to match. Shorter is better. The status checker shows every hop.
How many redirects can I add?
As many as you need, but very large lists can slow an Apache server slightly, because each rule is checked on every request. For a typical small business redesign with tens or a few hundred pages, .htaccess redirects are fine. Keep the list tidy. Remove rules nobody needs.
Do I need redirects when moving to Marketiism?
If your old site's addresses change, yes, wherever the old site's domain points. Where the domain now points to a new platform, set redirects on that platform instead of in .htaccess. Ask us on a call if you're moving a site. Plan redirects before switching.
Does it work on a phone?
Yes, you can generate the rules on a phone. Editing .htaccess on your server is safer from a computer, where you can back up the file and check the rules carefully before saving. Generating rules on a phone is fine, and nothing is uploaded while you do it.
Is it free?
Yes. The .htaccess redirect generator is free, with no sign-up and no limit. It's part of the free SEO tools from Marketiism, alongside the HTTP status checker for testing the redirects you create. Nothing is added to the code or text it produces, and you can use it for client and business work as often as you like.

Want this inside your own account?

Marketiism keeps your invoice numbers, GST reports, UPI payment links and WhatsApp reminders in one place. Leave your details and we'll call to set it up for your business, or start the trial yourself.

Start free trial

We use this only to contact you about Marketiism. No spam.

More SEO tools

URL Slug Generator

Turn titles into clean URL slugs, with accents removed and optional length and small-word trimming.

Robots.txt Generator

Build a robots.txt with blocked paths, a sitemap line and optional AI crawler blocks.

XML Sitemap Generator

Turn a list of page URLs into a valid sitemap.xml with optional dates, frequency and priority.

Meta Tag Generator

Write the title, description, robots, canonical and viewport tags for a page, ready to paste.

Open Graph Generator

Create Open Graph and X (Twitter) card tags and preview how your link looks when shared.

SERP Snippet Preview

See how your title and description may look in search results, with character and pixel estimates.

Try it on your own business for two weeks.

14 days free, no card. If you get stuck setting up WhatsApp, we'll get on a call and do it with you.