ADMISSIONS OPEN
🔥 Admissions Open • Book Your FREE Digital Marketing Demo Class • Limited Demo Slots Available • 🚀 Start Your Digital Marketing Career Today • 💼 Practical Training + Career Guidance • 🎯 Reserve Your Seat Before Today's Slots Fill
Book FREE Demo

htaccess Redirect Generator

Create .htaccess redirect rules for Apache and LiteSpeed servers. Paste old and new URLs for page redirects, and add HTTPS and www rules in one block of clean, ready-to-paste code.

How to add redirects in .htaccess

  1. List each redirect as old path | new URL. Add * at the end of a folder path to redirect everything inside it.
  2. Tick Force HTTPS and choose www if your site needs them.
  3. Back up your .htaccess file using your hosting file manager.
  4. Paste the code above the WordPress block, save, and test each old URL in a private window.
htaccess redirect generator steps

301 vs 302 redirects

CodeUse whenSEO
301The page has moved permanentlySignals move to the new URL
302The move is temporaryOld URL usually stays indexed

Tips for clean redirects

  • Redirect to the closest matching page, not always the homepage.
  • Avoid chains: point old URLs straight to the final page.
  • Update internal links to the new URLs too.
  • On WordPress, the Rank Math Redirections module or a redirection plugin is an easy alternative.

Check your list for chains with the redirect chain checker, use Nginx redirects for Nginx servers, and plan bigger moves with the site migration checklist.

More free tools and guides

More free tools like this htaccess redirect generator
Learn this hands-on

Practise tools like this on real projects in our digital marketing course in Faridabad, with weekday, weekend and online batches.

See the courseAll free toolsAsk on WhatsApp
htaccess redirect generator FAQ

Frequently Asked Questions

Is this htaccess redirect generator free?

Yes. It is free with no sign-up and works in your browser.

Does .htaccess work on LiteSpeed servers?

Yes. LiteSpeed reads Apache .htaccess rewrite rules, which many Indian hosts use.

Where do I find the .htaccess file?

In your site's root folder, often public_html. Show hidden files in your file manager to see it.

How long should I keep 301 redirects?

At least a year, and ideally permanently, so old links keep working.

Scroll to Top