webdevops / TYPO3-metaseo

TYPO3 MetaSEO Extension
https://typo3.org/extensions/repository/view/metaseo
GNU General Public License v3.0
38 stars 25 forks source link

[Feature] Select Protocol for Canonical #141

Closed al-Iskandar closed 8 years ago

al-Iskandar commented 9 years ago

If you do not enter a URL as canonical in the page properties, metaseo puts always the URL, the page is called. If you offer a page as http and as https, metaseo uses always the URL you called (http://example.com/page by http and https://example.com/page by https) for causes of SEO it would be helpfull, if there would be a constant for the site template which allows to select whether Metaseo shall use always http oder https as the protocol of the canonical.

thomaszbz commented 8 years ago

This feature request looks valid to me: Using one URL (with one protocol only) is all what the canonical URL meta tag is about. I agree, this is a basic feature when we talk about SEO.

Use case would be that one wants to offer both protocols with no protocol selection (e.g.https-only strategy). That makes sense at least during a transition phase towards a https-only strategy.

There should be an additional canonical config variable to go for http or https when nothing else is defined.

Hence, we need to make sure that visitors do not get bounced back (301'd via TYPO3's protocol selection in the page properties) to the other protocol when entering the canonical URL.

For user specified canonical Url in page properties we should take it 1:1, as it could be an external Url.

For canonical Url generation, we should

So the only thing we need to do is to switch protocol according to metaseo's config variable (if specified) in case TYPO3's protocol selection is unspecified (=default).

Plus, we need to think about using the same canonical Url for the sitemap (-> #200).

Comments on this are welcome.

thomaszbz commented 8 years ago

09e2499 implements this feature for the canonical URLs. It can be activated with plugin.metaseo.metaTags.canonicalUrl.fallbackProtocol = https in the constants section of a template.

@al-Iskandar Do you want to test it before it is merged?

al-Iskandar commented 8 years ago

Sorry, had no time for looking, but I can test it.

The first test looks good.

Thank you very much. A https-only strategy looks good with professional providers und high budget sites. But with low budget solutions like Start-SSL or sharing IPs there could still be a problem with visitors using Windows XP - especially if you are creating sites for countries outside of the Western industrial nations.

thomaszbz commented 8 years ago

@al-Iskandar You can checkout ccf8e22 with

git remote add thomaszbz https://github.com/thomaszbz/TYPO3-metaseo.git
git remote update thomaszbz
git checkout --track -b dev/141-canonical-fallback-protocol thomaszbz/dev/141-canonical-fallback-protocol

I assume you were already testing the patch?

These days, I guess XP-Users should go for e.g. Firefox which comes along with an OS-independent https implementation. At least, if XP is still supported by FF.

But indeed, there's still some old mobile devices in the field which might have problems with modern https-only web servers.