Current time: 11-27-2020, 10:33 PM Hello There, Guest! (LoginRegister)

Post Reply 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"D" and "F" grades on "First Byte Time" (Site times out over 50% of the time)
07-18-2014, 12:45 AM
Post: #6
RE: "D" and "F" grades on "First Byte Time" (Site times ...
I found a solution for the F-grade for First Byte Time on Wordpress sites when redirecting from www to non-www or the other way around.

It is: redirect in the .htaccess using the code at Stackoverflow about generic htaccess redirect www to non-www.

I added the code below at the top of the .htaccess file in the root of the http-folder. This made the redirect time go from 1.2s to 0.07s and gave me a B instead of a F. Hope it helps others too!

# redirect to www.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: "D" and "F" grades on "First Byte Time" (Site times ... - LeonC - 07-18-2014 12:45 AM

Forum Jump:

User(s) browsing this thread: 2 Guest(s)