New Zenner
- Join Date:
- Jan 2008
- Posts:
- 43
- Plugin Contributions:
- 0
HTTPS not showing information....
RodG:
I don't wish to confuse you, but there are actually three 'types' of links that can be used.
Absolute links.
Examples
http://somesite.com
http://somesite.com/some/path/file.html
https://somesite.com
https://somesite.com/some/path/file.php
http://yoursite.com
http://yoursite.com/some/path/file.html
https://yoursite.com
https://yoursite.com/some/path/file.phpRelative links.
Examples
index.php
/some/path/file.php
/some/other/path/file.html3) Protocol-agnostic links
Examples
//notMySite.com
//YetAnotherSite.com/some/path/file.htmlAbsolute links are 'robust' but not 'portable' . They can be/are used primarily to force the use of a specific protocol (http, https, ftp. file, etc). Although these links can point to your own domain name this isn't recommended as it causes an additional DNS lookup. It can also make things more complicated than they need be if the site needs to be migrated to a different domain.
Relative links can only be used to link to resources on your own site. In almost all cases these are the best ones to use where and when possible. The code is easily portable and there are no issues with http vs https.
Protocol-agnostic links are somewhat of a hybrid of the Absolute and Relative links. They are used primarily for offsite linking where the protocol either can't be explicitly set or where it isn't practical to do so.
ZenCart makes extensive use of dynamically generated Absolute Links as this enables HTTP/HTTPS to be explicitly given (essential for directing the client between SSL enabled and No SSL parts of the site).
Almost all 'user defined' links (eg, internal EZ-Page links, most links in the template files, and the links in most add-ons that don't need to connect to offsite/external servers will/should be using Relative links.Protocol-agnostic links should (at least in my opinion) only be used as a last resort in place of Absolute links to external servers if the protocol can't be dynamically assigned.
So, to answer you question as to whether you should go through the site and change all links to be protocol-agnostic, the answer is no. Only change the ones that are actually needed.
Cheers
RodG
... and this is why you're totally Zenned, great explanation of the three, I'm 50 and have been doing website design off and on since 1990.... I always learn something new, everyday dude!