Avoid Multiple Page Redirects
Redirections happen when the requested URL doesn’t have the OK response (200 status code), and instead has to be redirected to another URL.
A very common pattern of redirects happen when a user tries to access a non-canonical URL:
Another example when site visitors have to be redirected to a mobile version of the site:
- example.com redirects to m.example.com
Page redirects add delays to the page load. Nothing is shown to the site visitors while the redirections are occurring.
PageSpeed Insights audit will warn if a page has two or more redirects. The recommendation can be expanded for more details.
This is not something that WP Rocket can resolve. But we have some tips.
How to eliminate redirects
Even though redirects are sometimes necessary, minimizing their usage will reduce page load time and improve user experience.
- Point links to the resources' current locations.
- Redirects from HTTP to HTTPS and WWW to non-WWW can be combined.
You can prevent chaining redirections as in the example here:
Follow the documentation for a solution: https://docs.wp-rocket.me/article/965-combine-https-and-www-redirection-rules
- Use Responsive Design practices instead of redirects to the mobile versions of the site.
- In WordPress, make sure that your URL settings, found in Settings → General, are using the desired version of your URL, and that redirects point any other variations to these: