View Single Post
Old 06-11-2017, 10:59 PM  
tomash999
Confirmed User
 
Industry Role:
Join Date: Sep 2015
Posts: 88
Quote:
Originally Posted by porn-update View Post
No, the function is inserted in place of http (hand-written) in the code, so now everything is https, so http now no longer exists ...

before
Code:
<link rel="canonical" href="<?php echo 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; ?>" />
Now
Code:
<link rel="canonical" href="<?php echo URL_protocol().$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; ?>" />
That's good. Look at what I wrote in 2 and 3, move the logic from PHP to the server. The server should redirect traffic from http to https before it respond with HTML.
tomash999 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote