How to avoid multiple page redirects (2024)

Understand why you should minimize URL redirects, wherever possible, and identify the best practices to set up URL redirects.

Overview

In our audit documentation, we touched upon the fact that redirects can significantly affect your website’s performance.

In this article, we’ll explain in detail about how to optimally set up redirects for your website.

Redirection Best Practices

In general, try to avoid redirects as much as possible.

If, however, you cannot avoid them for whatever reason, GTmetrix always recommends URLs be redirected on the server-side as they are fast, cacheable, and can be implemented universally.

To this end, follow these best practices to ensure optimal use of redirects:

1) Favour Server-side (web-server or application), vs Client-side (HTML, or JavaScript) redirects

When dealing with server-side redirects, we recommend that they be executed via web server configuration as they are often faster than application-level configuration.

How to avoid multiple page redirects (1)

Server-side redirects happen immediately and help visitors reach their final destination sooner.


However, if the application itself is fast and optimized for performance, application-level redirects can be executed.

2) Say no to client-side redirects

Avoid client-side redirects, as much as possible, as they are slower, non-cacheable and may not be supported by browsers by default.

3) Avoid landing page redirects/Minimize redirect chains

Wherever possible, avoid landing page redirects; especially, the practice of executing separate, individual redirects for reasons such as protocol change, adding www, mobile-specific page, geo-location, and subdomain.

Always redirect to the preferred version of the URL, especially, when redirects are dynamically generated. This helps eliminate unnecessary redirects.

How to avoid multiple page redirects (2)

An example of an optimal redirect, going directly from http:// to https://www


For instance, if a website has both site.com and www.site.com, set up the redirect to directly forward from http://site.com to the preferred https version of the new URL (in this case https://www.site.com). This helps you skip an intermediate step in the redirect chain.

As a general rule of thumb, try and limit the number of redirects to 1, wherever possible.

4) Periodically review your redirects

Review the redirects in place from time to time to ensure that old and irrelevant redirects are removed.

How to avoid multiple page redirects (3)

An example of a long redirect chain.

Similarly, remove temporary redirects if not needed anymore.

Remember that combining multiple redirects into a single redirect is the most effective way to improve web performance.

A brief note on HTTP Strict Transport Security (HSTS)

HSTS is a response header that commands the browser to only load the HTTPS version of a website, ignoring any attempt to load the unencrypted HTTP version.

Here are a few key reasons why your website should be HSTS-enabled:

  • It provides an extra layer of security to prevent data-theft and phishing attacks. It also eliminates an unnecessary step in the redirect chain to improve web performance.
  • It’s supported by most modern browsers and references a pre-load list to verify that websites are HSTS-enabled.

However, be aware of possible HSTS downsides, such as:

  • If you have legacy configurations that are not equipped for HTTPS, they will break.
    • Only use the includeSubDomains directive when all subdomains are properly set up for HTTPS with the required SSL/TLS certificates.
  • Inclusion in the preload list cannot be easily undone.
    • To prevent the delayed removal of your website from the preload list, do not include the preload directive by default.


Learn more about HSTS and the preload list here.

Setting up redirects

The following are some basic guidelines for optimally executing redirects on various server types :

For Apache

To setup URL redirects, you’ll need to edit the .htaccess file as it allows overwriting of the central configuration at the directory level. We recommend that you create a backup of the original .htaccess file before you modify it.

Note that .htaccess files may be hidden, so make sure that any ‘Show hidden files’ options are enabled.

Refer to this article for comprehensive details on redirection using .htaccess files.

For NGINX

In NGINX, redirects are handled using a .conf file, namely the nginx.conf file, located in the /etc/nginx/ directory.

To execute NGINX redirects, follow the instructions in this article and modify the code as necessary.

For IIS

For the Microsoft IIS Server, follow the instructions in this Microsoft document to set up URL redirects for your website.

Summary

Avoiding multiple page redirects is one of the most important audits to optimize as redirects, by their very nature, can affect web performance and cause a poor page experience for your users.

Always try and avoid redirects as much as possible; however, remember that they may be unavoidable in many cases as site functionality may depend on them.

If you must execute redirects, follow some of the best practices – such as executing them server-side, combining multiple redirects into one, minimizing redirect chains, and periodically reviewing your redirects to remove unwanted redirects.

Depending on your web server, follow the appropriate instructions to optimally set up redirects for your site and then test your page using GTmetrix to see how much they improve your web performance!

Keep your site’s performance at the top of your mind

PRO Monitoring Splash

Get more On-Demand Tests, Monitored Slots and Advanced Analysis Options, along with Hourly Testing, with a GTmetrix PRO plan.

Other features include: Priority queue access, Mobile Testing, Remote Location Monitoring (including Premium Locations), and more!

Upgrade to PRO today!

Tags: avoid hsts minimize redirects

How to avoid multiple page redirects (2024)

FAQs

How to fix avoid multiple page redirects? ›

Redirection Best Practices
  1. 1) Favour Server-side (web-server or application), vs Client-side (HTML, or JavaScript) redirects. ...
  2. 2) Say no to client-side redirects. ...
  3. 3) Avoid landing page redirects/Minimize redirect chains. ...
  4. 4) Periodically review your redirects. ...
  5. For Apache. ...
  6. For NGINX. ...
  7. For IIS.
Nov 16, 2020

How do I bypass too many redirects? ›

How To Fix Too Many Redirects
  1. Clear cookies on the redirecting website.
  2. Clear your browser cache.
  3. Ensure your SSL certificate is installed correctly.
  4. Evaluate your third-party services and plugins.
  5. Reset your htaccess file.
  6. Contact your hosting provider.
Apr 3, 2024

How do I stop redirecting to another page? ›

See if the following steps will fix your issue.
  1. Check your browser settings. Make sure that your browser is not configured to redirect pages. ...
  2. Check your extensions. Some extensions can cause unwanted redirects. ...
  3. Scan your computer for malware. ...
  4. Contact the website you're trying to visit.
Mar 30, 2023

What are multiple page redirects? ›

Multiple page redirects will trigger multiple request-response cycles, which may significantly delay the start of your page load. The long redirect chain seen here means that the user sees nothing (blank) for 0.3 seconds.

How do I get rid of unwanted redirects? ›

Change your default pop-ups & redirects settings

On your computer, open Chrome. Settings. Pop-ups and redirects. Choose the option that you want as your default setting.

How do I reduce the number of redirects? ›

How to remove redirects?
  1. Search the redirect.
  2. Check the reason of its existence.
  3. Check how it is affecting others or others are affecting it.
  4. Remove if not required.
  5. Update the redirect if is affecting others or others are affected by it.
  6. Use HSTS to remove SSL redirect.

Why is my website redirecting too many times? ›

Why the error occurs. The “too many redirects” error occurs when your website is set up in a way that keeps redirecting it between different web addresses. When your browser tries to load your site, it goes back and forth between those web addresses in a way that will never complete — a redirect loop.

How do I skip a redirect link? ›

On Chrome, click "⋮" → "Settings" → "Privacy and Security" → "Site settings" → "Pop-ups and redirects". Make sure it's toggled on. On Firefox, you'll need to edit about:config to block page redirects. On Microsoft Edge, click "•••" → "Settings" → "Cookies and site permissions" → "Pop-ups and redirects".

How do I clear a URL redirect? ›

Open the Chrome Developer Tools (F12) Go to the Network tab and make sure Disable cache is ticked Reload (or navigate to) the page you no longer want to be redirected while keeping the dev tools open. This will clear the cached redirect.

How do I get rid of redirected pages? ›

Delete your Domain Redirect for Web Hosting
  1. Sign in to your My Services page.
  2. Click the Web Hosting link.
  3. Click Redirects in the Domains module.
  4. Under Current Redirects, click Delete for the redirect that you want to remove.
  5. Click the Remove Redirect button to confirm the removal.

Why does a website redirect to another page? ›

Website redirection, also called link forwarding, is used to make a web page available under more than one website address. When a web browser attempts to open a redirected link, it will go to a page with a different link. Malware authors use this sometimes so you will acccess their malicious websites accidentally.

Why does my browser keep redirecting me to other websites? ›

Chrome redirects can occur for various reasons including adware and malware infections, malicious plugins, compromised websites, clickjacking techniques, browser hijackers, outdated software, and security vulnerabilities.

How do I redirect a single page? ›

To redirect one HTML page to another page, you need to add a <meta> tag inside the <head> section of the old HTML page. The <head> section of an HTML document contains metadata that is useful for the browser, but invisible to users viewing the page.

Do multiple redirects hurt SEO? ›

Well, there is no limit to the number of HTTP 301 redirects and this number does not impact SEO. The only thing to avoid is too many redirect for the same page (i mean redirects in series) because it produces a lack of performance (loading speed) and so it damages the user experience.

How many redirects are allowed? ›

There is no limit of redirection. But keep in mind that more than two redirect have impact on SEO.

How do I fix the page isn't redirecting properly? ›

But if these fixes work, you'll save yourself from a lot of frustration and time.
  1. Clear the browser cache. ...
  2. Clear website cookies. ...
  3. Check your HTTPS settings. ...
  4. Check your Cloudflare SSL settings. ...
  5. Check the WordPress site settings. ...
  6. Disable WordPress plugins temporarily. ...
  7. Check your redirects.
Apr 11, 2024

Why won't my page open because of too many redirects? ›

Why the error occurs. The “too many redirects” error occurs when your website is set up in a way that keeps redirecting it between different web addresses. When your browser tries to load your site, it goes back and forth between those web addresses in a way that will never complete — a redirect loop.

Why does Safari keep saying too many redirects? ›

The ERR_TOO_MANY_REDIRECTS error occurs when a browser is stuck in a loop of redirects trying to load your webpage. This can happen for several reasons, including: Browser cookies and cache issues: Corrupted cookies and an outdated cache could cause a redirect loop that leads to the ERR_TOO_MANY_REDIRECTS error.

Top Articles
mSpy – Best Parental Control App for iPhone and Android
How to Verify an Email Address Without Sending an Email - Norbert
Public Opinion Obituaries Chambersburg Pa
Stadium Seats Near Me
Don Wallence Auto Sales Vehicles
Roblox Developers’ Journal
How do you mix essential oils with carrier oils?
Doby's Funeral Home Obituaries
You can put a price tag on the value of a personal finance education: $100,000
2021 Lexus IS for sale - Richardson, TX - craigslist
Oc Craiglsit
Hca Florida Middleburg Emergency Reviews
Aldi Sign In Careers
Dr Adj Redist Cadv Prin Amex Charge
Vandymania Com Forums
Jang Urdu Today
Google Doodle Baseball 76
Ratchet & Clank Future: Tools of Destruction
Leccion 4 Lesson Test
라이키 유출
Scout Shop Massapequa
Catherine Christiane Cruz
Reptile Expo Fayetteville Nc
Raz-Plus Literacy Essentials for PreK-6
Bjerrum difference plots - Big Chemical Encyclopedia
[PDF] NAVY RESERVE PERSONNEL MANUAL - Free Download PDF
Craigslist Battle Ground Washington
Sand Dollar Restaurant Anna Maria Island
Webworx Call Management
Revelry Room Seattle
Abga Gestation Calculator
Ofw Pinoy Channel Su
Dreamcargiveaways
Metra Union Pacific West Schedule
Mgm Virtual Roster Login
SF bay area cars & trucks "chevrolet 50" - craigslist
The Thing About ‘Dateline’
Mars Petcare 2037 American Italian Way Columbia Sc
Craigslist Tulsa Ok Farm And Garden
Indiana Jones 5 Showtimes Near Cinemark Stroud Mall And Xd
Metro Pcs Forest City Iowa
Obituaries in Hagerstown, MD | The Herald-Mail
Cnp Tx Venmo
Who Is Responsible for Writing Obituaries After Death? | Pottstown Funeral Home & Crematory
No Boundaries Pants For Men
Nina Flowers
Breaking down the Stafford trade
Mcoc Black Panther
Ronnie Mcnu*t Uncensored
Myapps Tesla Ultipro Sign In
Gummy Bear Hoco Proposal
Latest Posts
Article information

Author: Jonah Leffler

Last Updated:

Views: 5438

Rating: 4.4 / 5 (45 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Jonah Leffler

Birthday: 1997-10-27

Address: 8987 Kieth Ports, Luettgenland, CT 54657-9808

Phone: +2611128251586

Job: Mining Supervisor

Hobby: Worldbuilding, Electronics, Amateur radio, Skiing, Cycling, Jogging, Taxidermy

Introduction: My name is Jonah Leffler, I am a determined, faithful, outstanding, inexpensive, cheerful, determined, smiling person who loves writing and wants to share my knowledge and understanding with you.