Skip to main content
.com domains from $2.99 — free WHOIS privacy on every name

Request routing · Intermediate · 20 minutes, hops counted

How to set up 301 redirects — Every Redirect Is a Round Trip. Put the Rule in the Cheapest Layer

Three redesigns in, an old backlink now crosses four hops before it reaches a page, and every one of those hops is a round trip the visitor waits through.

The short answer

Serve the rule from the web server wherever you can, because a redirect handled in .htaccess costs one round trip while the same redirect handled by a WordPress plugin costs a round trip plus a full PHP boot and database connection. On a page with cached HTML the difference is the whole request: one is answered before PHP is involved, the other is not.

After that it is bookkeeping with a measurement attached. Map each old URL to its actual replacement rather than dumping everything on the homepage, count your hops with curl -IL so chains get flattened to one, and work the 404 log as a queue — every recurring 404 is a redirect you have not written yet.

By the HostingFast team · Reviewed 24 August 2026

Intermediate

Skill floor

5

Stages in the runbook

Free

Price of help

Proven

Tested on the live platform

For anyone who has inherited an .htaccess nobody understands. The habit this page is really teaching is the ledger: old URL, new URL, date, reason — because in three years the rules become untouchable without it.

The measurement is hop count and response time. curl -IL against an old URL prints every hop and its status code, and that output is the difference between a redirect that works and a redirect that works four times in a row.

Where the rule lives decides what it costs

A rule in .htaccess is evaluated by the web server before anything else runs. A rule in a redirect plugin is evaluated after WordPress has loaded, which means PHP has started, the database has been queried and the plugin stack has initialised — all to produce a response whose entire content is a Location header.

Use the plugin for what it is good at: editorial moves, non-technical users, bulk imports of a migration map. Use server-level rules for patterns, protocol and host canonicalisation, and anything receiving real traffic. One mechanism per redirect, so nothing ends up fighting itself.

Count the hops before you add another

curl -IL against an old URL prints every hop with its status. Anything longer than one hop is costing visitors a round trip they do not need and diluting what passes through. Chains build up quietly across redesigns: A points to B, B later points to C, and nobody goes back to repoint A.

Flatten on a schedule. Once a year, list every rule, resolve each one to its final destination and rewrite the original to point straight there. It is dull work that takes an afternoon and removes an entire class of slow requests from old links you cannot control.

Pick the right code, and know what it preserves

301 is a permanent move and the default for a page that has relocated for good. 302 says temporary — reserve it for genuinely temporary detours, because it tells crawlers to keep the old URL. 308 is the permanent redirect that also preserves the request method, which matters when a POST endpoint moves and you do not want it silently converted to a GET.

Map old to new individually. Bulk-redirecting an entire retired section to the homepage is technically a redirect and practically a dead end: the visitor arrives somewhere that does not contain what they clicked for, and the deep-link value goes nowhere useful.

Redirects and caching, and the log that never lies

Add a rule and purge, because a cached copy of the old URL will keep answering happily and you will conclude your rule does not work. Verify with curl rather than in a browser, since browsers cache permanent redirects aggressively and will keep following a rule you deleted an hour ago.

Then treat the 404 log as your queue. Search Console lists old URLs still being requested and the raw access log in cPanel shows the rest, including the ones no crawler cares about but a customer does. Every repeated 404 in there is a redirect waiting to be written, and it is the only complete source of them.

A website being carried across to its new host from a laptop

Where these rules are executed

Server-level rules are read by the web server before PHP is involved, and LiteSpeed is compiled into that server rather than added by plugin. A redirect answered there is answered in a fraction of the time the same rule takes from inside WordPress.

Free SSL on every plan, reissued automatically before it can expire — which is what the http-to-https canonical rule depends on.

  • Rules evaluated by the web server, before PHP starts
  • File Manager and SSH for editing .htaccess directly
  • Daily backups, so a bad rewrite rule is a one-click recovery
  • Free auto-renewing SSL behind the https canonical rule

Why HostingFast

Standard on every plan

Costed by layer

Server rule versus plugin rule is presented as what it is: one round trip against a round trip plus a PHP boot.

Hops actually counted

curl -IL turns redirect chains from an abstraction into a number you can watch fall to one.

Codes chosen deliberately

301, 302 and 308 each do a different job, and method preservation is called out before a POST endpoint breaks.

One-to-one mapping

Old URL to actual replacement, because a section redirected wholesale to the homepage is a dead end wearing a 301.

Cache interaction handled

Purge and verify with curl, not with a browser that has already memorised the permanent redirect you deleted.

The 404 log as a queue

Search Console plus the raw access log give you the complete list of redirects still owed, ranked by demand.

Quick Start

From order to online

  1. 1

    Build the map before touching anything

    Old URL to its actual replacement, one row each, in a file you keep. This ledger is what makes the rules maintainable three years from now.

  2. 2

    Put each rule in the cheapest layer

    Patterns, protocol and host canonicalisation in .htaccess; editorial one-offs in the plugin. One mechanism per redirect, never two.

  3. 3

    Choose the status code on purpose

    301 for a permanent move, 308 where the request method must survive, 302 only for detours that genuinely end. The wrong code is a slow, quiet error.

  4. 4

    Count hops with curl -IL

    Every chain longer than one hop gets repointed at its final destination. Run it against your oldest, best-linked URLs first.

  5. 5

    Purge, verify, then work the 404 log

    Clear the cache, re-check with curl, then read Search Console and the access log for old URLs still being requested. That list is the rest of the job.

Built In

Loaded onto every plan

  • LiteSpeed caching compiled into the server, not bolted on by plugin
  • cPanel — the control panel most of the industry already runs
  • SSH, Git and Composer on the developer-focused plans
  • Free SSL on every plan, reissued automatically before it can expire
  • Daily backups on every plan, with restores you run yourself from the panel
  • NVMe SSD storage on every tier, including the entry plan
  • Staging environments for rehearsing a change before it ships
  • Per-site PHP version switching from the control panel
  • A renewal price identical to the one you signed up at
  • Human support on duty every hour of every day

Frequently Asked

What people ask us most often

How do I count the hops in a redirect chain?

curl -IL against the old URL prints every hop with its status code and final destination, which is the fastest way to discover that a five-year-old backlink is crossing four redirects to reach a live page. Do not check in a browser: it caches permanent redirects hard and will happily keep following a rule you deleted an hour ago.

Is a plugin redirect measurably slower than an .htaccess rule?

Yes, because of what has to happen before the plugin sees the request. A server-level rule is evaluated before PHP starts; a plugin rule requires WordPress to boot and query the database first, and the entire useful output of that work is one Location header. For high-traffic redirects the difference is worth the extra minute in File Manager.

Do redirects interfere with page caching?

They interact with it, and the usual symptom is a rule that appears not to work. A cached copy of the old URL keeps being served until you purge, so add the rule, purge, then verify with curl. Rules at the server level are evaluated ahead of the cache, which is another reason to prefer them for anything busy.

When should I use 308 rather than 301?

When the request method has to survive the move. A 301 permits a client to convert a POST into a GET, which silently breaks a relocated form or API endpoint; a 308 is equally permanent and preserves the method. For ordinary page moves 301 remains the right and better-understood choice.

Keep reading

  • How to Pick a WordPress Page Builder

    Choose between the block editor and a builder on what each one costs the page, measured rather than argued — beginner, roughly an evening of testing.

  • How to Install an SSL Certificate

    A certificate issued, installed and renewing itself, with the chain checked from outside — beginner, roughly 0–20 minutes.

  • 301 Redirect (Glossary)

    The permanent redirect explained at the protocol level, including what it does and does not pass on.

  • WHMCS License

    Automate billing, provisioning and support for your own hosting clients.

  • Web Hosting

    cPanel hosting on NVMe behind a LiteSpeed cache — SSL, migration and a year-one domain included.

Changing hosts? Run through our checklist first.

A straightforward sequence for a switch your visitors never feel: which files move first, how to shift email across without losing a single message, the right moment to repoint DNS, and the two mistakes behind almost all the downtime we get asked to rescue.

You'll get the checklist email, then occasional pointers on keeping a site running fast. Unsubscribe the moment you want out — the privacy policy covers the rest.

Answer the redirect before PHP starts.

LiteSpeed compiled into the server, .htaccess in File Manager or over SSH, daily backups, and free auto-renewing SSL.

View WHMCS License plans