R11 Canonical link not updated when Storewide SSL enabled
Posted: Fri Feb 19, 2016 3:57 am
I've doing quite a bit of work with Facebook Open Graph tags recently and have discovered something.
When the store is configured for storewide SSL, the PageHelper.BindMetaTags() routine does not update the canonical link accordingly. It's still populated as HTTP even though the entire store is HTTPS.
This causes redirect issues with places like Facebook. Facebook sees the HTTPS url, but then takes the specifical HTTP canonical link as gospel and tries to hit it. But hitting the HTTP url forces a redirect back to HTTPS. So Facebook gets stuck in a redirect loop trying to hit a canonical url that will always force a redirect and it just loops over and over.
In the Facebook debugger, you'll see this: The underlying reason for this is the Store Url in the Configure->Security->System Settings page. When you enable SSL on all pages, the store url is not updated accordingly. So this causes pages to render with a HTTP canonical url while the actual page is HTTPS.
I tested updating the store url to HTTPS, and it seems to be a suitable workaround. Facebook seems to like it just fine now.
I looked in the R11 SR patch notes, didn't see this one listed. So I thought I would mention it in case anyone else encountered it.
When the store is configured for storewide SSL, the PageHelper.BindMetaTags() routine does not update the canonical link accordingly. It's still populated as HTTP even though the entire store is HTTPS.
This causes redirect issues with places like Facebook. Facebook sees the HTTPS url, but then takes the specifical HTTP canonical link as gospel and tries to hit it. But hitting the HTTP url forces a redirect back to HTTPS. So Facebook gets stuck in a redirect loop trying to hit a canonical url that will always force a redirect and it just loops over and over.
In the Facebook debugger, you'll see this: The underlying reason for this is the Store Url in the Configure->Security->System Settings page. When you enable SSL on all pages, the store url is not updated accordingly. So this causes pages to render with a HTTP canonical url while the actual page is HTTPS.
I tested updating the store url to HTTPS, and it seems to be a suitable workaround. Facebook seems to like it just fine now.
I looked in the R11 SR patch notes, didn't see this one listed. So I thought I would mention it in case anyone else encountered it.