Website Tools

301 Redirects: How to Move Pages and Domains Without Losing Traffic

Renamed a page, switched to HTTPS or moved to a new domain? Redirects send visitors and search engines to the right place – and keep the rankings you built.

In this article
  1. 301 or 302?
  2. Common jobs
  3. How to generate the rules
  4. Editing .htaccess safely
  5. Avoid chains and loops
  6. Moving to a new domain: checklist
  7. Not using Apache?
  8. Find pages that need redirects

301 or 302?

CodeMeansUse for
301Moved permanentlyRenamed pages, new domains, HTTPS, merged content
302Found / temporaryShort-term changes, such as a page under maintenance

A 301 tells search engines to transfer the old page’s signals to the new address. Browsers also remember 301s, so test carefully before going live.

.htaccess Redirect GeneratorGenerate Apache .htaccess rules to force HTTPS, add or remove www, move a site to a new domain and 301-redirect old pages to new ones. Copy-ready code.
Open the free tool

Common jobs

  • Force HTTPS: every http:// request goes to https://.
  • Choose www or non-www: pick one version so links and rankings are not split.
  • Move a whole site: old-domain.com/any-page → new-domain.com/any-page.
  • Single pages: /old-services/ → /services/web-design/.

How to generate the rules

  1. Open the .htaccess Redirect Generator.
  2. Tick site-wide rules: force HTTPS, add or remove www, or enter a new domain.
  3. Add any number of single-page redirects (old path → new address) as 301 or 302.
  4. Read the warnings – for example, choosing both “add www” and “remove www” would create a loop.
  5. Copy or download the code.

Editing .htaccess safely

  1. Download a backup of your current .htaccess file (via your host’s file manager or FTP). It is hidden by default – enable “show hidden files”.
  2. On WordPress, paste your rules above the # BEGIN WordPress block, never inside it – WordPress rewrites that block.
  3. Save, then test old addresses in a private browser window.
  4. If the site shows an error 500, restore the backup immediately and check the rules for typos.

Avoid chains and loops

A chain is A → B → C. Each hop slows visitors down, and search engines may stop following after several. When you move a page again, update old redirects to point straight to the final address. A loop (A → B → A) makes the page unreachable; browsers show “too many redirects”.

Moving to a new domain: checklist

  • Redirect every old URL to its equivalent – not everything to the new home page.
  • Update internal links, canonical tags and your sitemap.
  • Use Google Search Console’s Change of Address tool.
  • Keep the redirects in place for at least a year – ideally permanently.

Not using Apache?

.htaccess works on Apache and LiteSpeed servers, used by most shared hosting. Nginx ignores it – ask your host for equivalent server rules, or use a redirect plugin in WordPress. Cloudflare and some hosts also offer redirect rules in their dashboards.

Find pages that need redirects

Google Search Console’s Pages report lists “Not found (404)” URLs that Google has seen. Map each to its best new page. Check your URLs with the URL Parser, and update your sitemap with the XML Sitemap Generator afterwards.

.htaccess Redirect GeneratorGenerate Apache .htaccess rules to force HTTPS, add or remove www, move a site to a new domain and 301-redirect old pages to new ones. Copy-ready code.
Open the free tool
Keep reading

Related articles

All articles
Web

Robots.txt Explained – What to Block, What Not to Block

Robots.txt is a small text file with big consequences. One wrong line can hide a whole site from Google. Here is how it works and what a safe file looks like.

3 min read
Web

Do You Need an XML Sitemap? How to Make and Submit One

A sitemap lists the pages you want search engines to find. It will not lift your rankings on its own, but it helps new and large sites get discovered faster.

3 min read
Web

The Anatomy of a URL – Every Part Explained

Web addresses look like random strings, but every part has a job. Understanding them helps with SEO, analytics, debugging – and spotting scam links.

3 min read