Skip to content
DA PA Checker

Free tool

.htaccess Redirect Generator

Create 301 redirects, force HTTPS and www rules for Apache and LiteSpeed.

The redirect generator writes .htaccess rules for Apache and LiteSpeed servers: force HTTPS, choose www or non www, and add 301 redirects for moved pages.

Copy the code and paste it at the top of your .htaccess file.

How to use it

  1. Choose HTTPS and www options.
  2. Add old and new paths, one pair per line.
  3. Copy the code into your .htaccess file and save.

Before you paste

  • Make a backup of your current .htaccess file.
  • Paste the rules above the WordPress block.
  • Test the old URLs with our redirect checker afterwards.

Tip

If your site uses Nginx, these rules will not work. Ask your host to add the same redirects in the Nginx config.

Questions

Can a mistake break my site?

Yes, a wrong rule can cause an error. Keep the backup so you can undo quickly.

301 or 302?

Use 301 for permanent moves. It passes link value to the new page.

Do I need both HTTPS and www rules?

Use both if you want one single version of every URL, which is best for SEO.

More free tools

DA PA CheckerDomain and Page Authority with DC Score.Bulk DA PA CheckerCheck up to 200 domains at once.Compare DomainsYour site against four competitors.Page Authority CheckerCheck the Moz Page Authority of any page, plus DA, spam score and DC Score.Spam Score CheckerFind out how spammy a website looks to search engines before you link to it or buy it.Domain Age CheckerSee when a domain was registered, when it expires and when it was first archived.WHOIS LookupRegistrar, registration and expiry dates and name servers of any domain.DNS LookupA, MX and NS records of any domain in one place.SSL CheckerCheck if a site has a valid SSL certificate, who issued it and when it expires.Redirect CheckerFollow every redirect of a URL and see each status code, 301, 302 and more.Website Traffic CheckerEstimate the monthly visits of any website from its global traffic rank.SEO Audit ToolScan any page for 20 SEO checks: titles, headings, speed, indexing, schema and more, with clear fixes.Guest Post Site CheckerIs a site worth a backlink? Authority, spam, traffic, outbound links and age in one verdict.Outbound Links CheckerSee every external link on a page, with dofollow or nofollow and the DC Score of each linked site.Sitemap CheckerFind a site's sitemap, count its URLs and test that the pages load.Keyword Ideas GeneratorHundreds of long-tail keyword and question ideas from real search suggestions.Domain Name GeneratorBrandable domain ideas from one keyword, with live availability.Website Uptime MonitorWe check your site every 5 minutes and email you the moment it goes down.Page Speed CheckerGoogle PageSpeed scores for mobile and desktop, Core Web Vitals and what to fix first.Broken Link CheckerTest every link on a page and find the ones that return errors.SERP Preview ToolSee how a page looks in Google and on social media, and edit the title and description live.Robots.txt TesterCheck if Google can crawl a URL, read the rules, or build a new robots.txt.Schema Markup GeneratorFill a short form and copy ready JSON-LD for FAQ, Article, Organization or Local Business.Word CounterWords, characters, sentences, reading time and keyword density as you type.UTM Link BuilderBuild tracking links for Google Analytics in seconds.Website Worth CalculatorAn estimate of what a website could sell for, from its traffic, age and authority.