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 1 vote.
Please wait...

You may also like...

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
0