Streaming live at 10am (PST)

Href lang code for sites in different countries


#1

Hey guys,

I saw a discussion here regarding Href lang for multiple countries but it wasn't actually answered. Just wondering if there's any solution other than manually adding the href lang code in every single pages.

Normally in wordpress, they have a dynamic code you can include in the site-wide settings like this:
<link rel=”alternate” href=”https://www.collectivecampus.com.au<?php echo parse_url($SERVER[‘REQUESTURI’],PHP_URL_PATH); ?>” hreflang=”en-au” />
<link rel=”alternate” href=”https://www.collectivecampus.com.sg<?php echo parse_url($SERVER[‘REQUESTURI’],PHP_URL_PATH); ?>” hreflang=”en-sg” />

But this doesn't work on webflow so I'm wondering if there's an alternative. This is mainly for our SEO.


#2

You cannot run PHP (or any other server-side) code in Webflow, and there is no variable you can use to get the current page URL. So, no workaround at all if you are hosting with Webflow.

<?php echo parse_url($SERVER[‘REQUESTURI’],PHP_URL_PATH); ?>