Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides
https://forum.ivorde.com/

PHPBB-SEO sets canonical URL to http when server protocol is set to HTTPS
https://forum.ivorde.com/phpbb-seo-sets-canonical-url-to-http-when-server-protocol-is-set-to-https-t19769.html
Page 1 of 1

Author:  mandrei99 [ Mon Feb 16, 2015 3:51 pm ]
Post subject:  PHPBB-SEO sets canonical URL to http when server protocol is set to HTTPS

Canonical URLs are a way of setting a fixed resource URL when the same resource is servered over multiple URLs (duplicate URLs).

A bug in phpbb_seo_class.php file incorrectly checks if server protocol is HTTP or HTTPS, thus causing canonical URLs to be set to http. Example of CANONICAL URL for ivorde.com forum before fix:
Code:
<link rel="canonical" href="http://forum.ivorde.com/" />


TO fix this, open ./phpbb_seo/phpbb_seo_class.php and find the following line:
Code:
...
      $this->ssl['forced'] = (bool) (($config['server_protocol'] === 'https//'));
...


Notice it checks for "https//". replace this with the following line:
Code:
...
      $this->ssl['forced'] = (bool) (($config['server_protocol'] === 'https://'));
...


And now canonical urls are set with correct server protocol.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/