Use HTTP to HTTPS But Avoid URL Redirects for Website Speed Test

I have analyzed my website speed test using Pingdom and GTmetrix today. Noticed that the Pingdom Performance Grade was B because of Avoid URL redirects Grade C (HTTP to HTTPS redirection) and the GTMetrix PageSpeed Score was B (86%). I have gone through the Pingdom and GTMetrix recommendations below.


URL redirects are made using HTTP status codes 301 and 302. They tell the browser to go to another location. Inserting a redirect between the user and the final HTML document delays everything on the page since nothing on the page can be rendered and no components can be downloaded until the HTML document arrives.


Avoid landing page redirects for the following chain of redirected URLs.
http://systemfixes.com/
https://systemfixes.com/
https://www.systemfixes.com/


So I found that the redirection configured from client-side using my web hosting and not from server-side to reduce client-side Round-Trip Time (RTT) requests. Minimizing HTTP redirects from one URL to another cut out additional RTTs and wait time for users.

Therefore, I have disabled HTTP to HTTPS redirection from web hosting and enabled redirection using a .htaccess file. Here is the simple code that you need to add into your .htaccess file to redirect all web traffic.

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]

Then analyze again for website speed test. The Pingdom Performance Grade has been changed to A and the GTMetrix PageSpeed Score has been changed to A (90%) now.

That’s it. 😉

Rating: 5.0/5. From 2 votes.
Please wait...

You may also like...

15 Responses

  1. thanks for a very good explanation, I have done same, but still comes up with the warning with avoid landing redirects, it does redirect, but running the speed tests, comes up with same warning

    • Charitha Buddhika says:

      Hello Stig, Please let me know your Domain, so I will be able to help you on this case. Thank you

  2. Nandhini says:

    Hello,

    Can you please help me in optimizing my website. It is https://greenintlupdaexamtraining.com. I get lot of request.. How can i reduce the number of requests and improve SEO?

  3. Dinesh kumar says:

    Hello sir,
    my website have got lot of minimize redirect error. Please give me a suggestion to fix the errors sir. My website is http://greekacadamic.in/

  4. fatih says:

    Hi

    we have com and .com/en/ multilanguage site. How do apply your code to .htaccess in the format?

    Also how do we remove server side https redirection from cpanel?

  5. Hi there are you able to help me optimize my site, it has a lot of redirects

  6. Sakthi says:

    Hi. can you please help me to fix Avoid landing page redirects and Make fewer HTTP requests issues for my website.

  7. Chathura says:

    Hey,
    I got the same redirection errors and don’t have proper knowledge to do this.

  8. Zahida Noor says:

    very good explanation, I have done same

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTTP to HTTPS But Avoid URL Redirects for Website Speed Test

time to read: 1 min
15