.htaccess redirect generator
Moving pages or switching to HTTPS? Generate the Apache .htaccess rules you need — force HTTPS, pick www or non-www, and add bulk 301 redirects from old URLs to new ones.
How to use the .htaccess Redirect Generator
- Tick Force HTTPS and choose your www preference.
- List each redirect on its own line: old path, a space, then the new URL.
- Copy the code to the top of the .htaccess file in your site root (back it up first).
Features
- Bulk 301 or 302 redirects
- Force HTTPS
- Force www or non-www
- Works on Apache and LiteSpeed hosting
Who is the .htaccess Redirect Generator for?
Keep your Google rankings when you move pages, change URLs or switch to HTTPS on Hostinger, cPanel and other shared hosting.
Shared premium SEO tools from ৳300/month — instant access, bKash & Nagad, 48-hour refund.
Frequently asked questions
301 or 302?
Use 301 for permanent moves — it passes ranking signals to the new URL. Use 302 only for short-term changes, like a page that is temporarily down.
Does this work on Nginx?
No. .htaccess is for Apache and LiteSpeed servers (most shared hosting, including Hostinger and cPanel hosts). Nginx needs rules in the server config.
My site shows “too many redirects” — why?
Usually HTTPS is already forced by your host or Cloudflare. Remove the Force HTTPS block, or set Cloudflare SSL to Full.