Page 1 of 1

SEO same content in 2 countries, how to implement hreflang?

Posted: Tue 31. Mar 2015, 11:36
by macangelo
Hi,

I have almost the same text on two websites: mydomain.de and mydomain.ch. Both sites are in German language, one for Germany, one for Switzerland. The SEO advisor says that I need for example the following in the header to prevent Google for punishing me for double content:

<link rel="alternate" href="http://mydomain.ch/ch-subject.html" hreflang="de-CH" />
<link rel="alternate" href="http://mydomain.de/de-subject.html" hreflang="de-DE" />

Now, the "ch-subject.html"-part of the URL is generated per url-rewrite in the .htaccess file.
And the url-rewrite script of cause uses the alias of the article - let's say "ch-subject".

What do I put in my header (usually in the template) to generate these tags for each articles? Or how do I do that?

Thanks a lot

Re: SEO same content in 2 countries, how to implement hrefla

Posted: Tue 31. Mar 2015, 15:55
by Old Boy
Isn't it possible, to use 2 separate main templates for the different "languages"???

Re: SEO same content in 2 countries, how to implement hrefla

Posted: Tue 31. Mar 2015, 16:01
by macangelo
It is. These are even 2 separate phpwcms installations running under different IPs.

Still - maybe I have a little block in my brain ;-) - but how do I get the specific link tags with the specific url in each and every article's head?

Re: SEO same content in 2 countries, how to implement hrefla

Posted: Wed 1. Apr 2015, 07:48
by Oliver Georgi
no need to have different templates, first I would configure the lang config for your needs. Then you have the correct lang attribute in the <html> tag.

The <link> can be generated using frontend render. If it's done well it's also not that hard to switch the domain too based on detected language and keep everything on the same hosting account inside the same CMS installation.

There is more https://support.google.com/webmasters/topic/2370587