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. ?
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
Hello Stig, Please let me know your Domain, so I will be able to help you on this case. Thank you
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?
I have sent you an email for your request. Thank you
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/
Please send me an email to [email protected]
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?
Please send me an email to [email protected]
Hi there are you able to help me optimize my site, it has a lot of redirects
Please send me an email to [email protected]
Hi. can you please help me to fix Avoid landing page redirects and Make fewer HTTP requests issues for my website.
Please send me an email to [email protected]
Hey,
I got the same redirection errors and don’t have proper knowledge to do this.
Please send me an email to [email protected]
very good explanation, I have done same