PageSpeed fix guide ·

Avoid multiple page redirects (Document request latency): how to fix it

PageSpeed Insights flags redirects under Document request latency, the Lighthouse 13 insight that replaced Avoid multiple page redirects. A redirect makes the browser ask a second time before it gets the page, and each extra trip across the network delays everything else. The fix: point the domain, internal links and ads straight at the final address, so visitors arrive in one step.

In PageSpeed Insights
Document request latency
Older name
Avoid multiple page redirects
In a FlashMax report
Extra hops before the page

0.5% of the 40,951 WooCommerce stores FlashMax tested have this problem. See the study

The short fix

  1. Test the address people actually use (with http:// or without www) and note every hop.
  2. Set WordPress Address and Site Address to the final https:// address.
  3. Make the server send every old variant of the address to the final one in a single 301.
  4. Update menus, internal links, ads and email links to the final URL.
  5. Re-test until the final address loads with no redirect.

What PageSpeed Insights is telling you

Lighthouse 13 folded the older Avoid multiple page redirects audit into Document request latency, an insight in the Insights list of PageSpeed Insights. The same insight also checks server response time and compression. Its redirect check is stricter than the old audit, which failed only at two or more redirects: the insight flags the page when the request for it was redirected even once.

A redirect is the server answering with a status such as 301 Moved Permanently and a Location header that names another address, which the browser then requests. Several hops in a row form a redirect chain.

FlashMax shows this as the card Extra hops before the page when redirects cost more than 100 ms.

Why redirects slow the page

Each hop is a full extra request, sometimes with a new DNS lookup and connection, and it happens before the real page has even been requested. TTFB includes redirect time, so every hop pushes First Contentful Paint and Largest Contentful Paint back by the same amount.

web.dev points out that visitors from ads and newsletters are hit hardest, because those links often pass through tracking redirects before they reach your site. Your own redirect then adds one more hop to a chain that is already long.

How common it is

In our study of 40,951 WooCommerce stores, only 0.5% (199 stores) got this card. Their median phone score was 47, against 52 for stores without it; with so few stores, read that as a correlation, not proof. A test only sees the hops on the address you give it, so check the other ways in too. More numbers are in the WooCommerce speed study.

How to find every hop

Test the address the way visitors reach it: http:// instead of https://, without www, or the exact link from your ad. In PageSpeed Insights, Document request latency says whether the page was redirected; the FlashMax test shows the card when the hops cost more than 100 ms.

In Chrome DevTools, open the Network panel, tick Preserve log and load the old address: every row with a 301, 302, 307 or 308 status is one hop. In a terminal, this prints the number of hops, their time and the final address:

curl -s -o /dev/null -L -w "%{num_redirects} redirects, %{time_redirect}s, final: %{url_effective}\n" http://example.com/

The usual sources of extra hops:

  • http:// to https://, then to www (or the reverse): two hops where one would do.
  • A missing or extra trailing slash, which web.dev lists as a common cause.
  • Menus and links that still use an old address, an old product URL or http://.
  • Ads, emails and social links that pass through link shorteners or tracking services.
  • Redirects that send phones to a separate mobile site.

How to fix it on WordPress and WooCommerce

Set the final address once

In Settings > General, enter the final address in WordPress Address (URL) and Site Address (URL), with https:// and with or without www exactly as you want visitors to see it. If you can't edit the fields, the values are set in wp-config.php (WP_SITEURL and WP_HOME) and must be changed there.

Send every old address to the final one in one hop

Every old variant (http://, with or without www) should go straight to the final address with the same path. On Apache (or a server that reads .htaccess), put this above the WordPress block, with your own final host name in both places:

RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule ^ https://www.example.com%{REQUEST_URI} [L,R=301]

If the site sits behind a CDN or proxy that connects to your server over plain HTTP, %{HTTPS} is always off there and this rule loops. Ask your host for the right check in that case. On nginx, give the old variants their own server blocks:

server {
    listen 80;
    server_name example.com www.example.com;
    return 301 https://www.example.com$request_uri;
}
server {
    listen 443 ssl;
    server_name example.com;
    # ssl_certificate and ssl_certificate_key for example.com go here
    return 301 https://www.example.com$request_uri;
}

The main server block for www.example.com stays as it is; $request_uri keeps the path and query string.

Fix links at the source

Update menus, buttons and links in pages and product descriptions to the final URLs. Old http:// links left in content after a move to HTTPS can be updated with a database search-and-replace tool that has a dry-run mode; back up the database first. Use the full final address in ads, emails and social profiles.

WooCommerce: check the customer location setting

In WooCommerce > Settings > General, Default customer location has an option called Geolocate (with page caching support). With it, WooCommerce adds a ?v= hash to your URLs: when a visitor's location isn't known yet or has changed, the page redirects to the same address with that parameter added. To avoid these query strings, WooCommerce suggests the plain Geolocate option; the caching variant exists so location-based taxes and shipping work on cached pages, so check those after switching.

Skip the http:// hop for returning visitors

The Strict-Transport-Security (HSTS) header tells browsers to go straight to HTTPS for your domain on later visits, so they skip the http:// hop. Turn it on only when the whole site works over HTTPS.

Shopify and hand-built sites

Shopify runs the servers, so you can't edit redirect rules there. Keep links in menus, ads and emails on your main domain and the final product or collection URL. Use Content > Menus > View URL Redirects only for pages that no longer exist: Shopify lets you redirect only from broken URLs, and a URL that still loads a page can't be redirected.

Hand-built sites: use one server-level 301 per old address, as in the examples above, and keep a redirect map in which every old URL points straight to its final address, never to another redirect.

Mistakes to avoid

  • Redirect loops. A rule that sends HTTPS back to HTTP, often behind a CDN, never ends. Test in a private window after every change.
  • Editing .htaccess without a copy. A typo there can take the whole site down. Keep the working file.
  • Turning on HSTS too early. Once browsers have the header, they use HTTPS only for your domain until it expires.
  • Separate mobile sites. Sending phones to an m. subdomain adds a hop to every mobile visit; Lighthouse recommends a responsive design instead.

How to check that it worked

Run the curl command or the DevTools check on every old variant of your address. Each should reach the final page in one hop, and the final address itself in none. Then test the final page with FlashMax or PageSpeed Insights 2 or 3 times, since lab results vary from run to run.

Real-user data in PageSpeed Insights and Search Console covers the last 28 days, so allow about four weeks for it to change.

Questions people ask

How many redirects are too many?

For the page itself, Lighthouse 13 flags even one. A single hop from http:// or the bare domain is hard to avoid for people who type your address, but links you control should point at the final URL with no redirect at all.

Why does PageSpeed Insights show no redirect when visitors still get one?

It tests the exact address you paste. If that is the final https:// address, there is nothing to redirect; the hop happens only when someone starts from http://, the bare domain, an old link or an ad. Test those addresses too.

Why does my WooCommerce URL end with ?v= and a code?

That comes from Default customer location set to Geolocate (with page caching support) in WooCommerce > Settings > General. WooCommerce suggests the plain Geolocate option if you don't want those query strings, but check taxes and shipping on cached pages afterwards.

Sources

  1. Document request latency (Chrome for Developers)
  2. Avoid multiple page redirects (Lighthouse docs, Chrome for Developers)
  3. Optimize Time to First Byte (web.dev)
  4. Settings General screen (WordPress.org documentation)
  5. MaxMind geolocation integration (WooCommerce documentation)
  6. Making geolocation static cache friendly (WooCommerce developer blog)
  7. Creating and managing URL redirects (Shopify Help Center)
  8. Module ngx_http_rewrite_module (nginx.org)
  9. Apache module mod_rewrite (httpd.apache.org)

Rather have it done?

The FlashMax team fixes the issues in your report, on a copy first, and shows the before-and-after.

See the speed optimization service

              AMERICANEXPRESSPayPalDISCOVERstripeVISA