We want translate our .com site, and decided to use different country specific top-level domain names, like:
- www.mywebsite.com
- www.monsiteweb.fr
- www.misitioweb.es
- ...
Now, from a maintenance perspective, we prefer to use the same host AND page for all languages. So, for example, every top level domain will link to the exact same index.php file, and we'll just check the top level domain in PHP and fetch the correct language from the database.
If we want to change the layout a bit, we only need to change one file (index.php), and not a file per language, that's a bit the idea. The same goes for all our other .php pages on our host.
My question is: how should I do the HTML-tagging properly with this set up? Should I just include all the tags in the same .php file, like so?
<head>
<title>Widgets, Inc</title>
<link rel="alternate" hreflang="en"
href="http://www.mywebsite.com" />
<link rel="alternate" hreflang="fr"
href="www.monsiteweb.fr" />
<link rel="alternate" hreflang="es"
href="www.misitioweb.es" />
<link rel="alternate" hreflang="x-default"
href="http://www.mywebsite.com" />
</head>
And for other pages:
<head>
<title>Widgets, Inc</title>
<link rel="alternate" hreflang="en"
href="http://www.mywebsite.com/about.php" />
<link rel="alternate" hreflang="fr"
href="www.monsiteweb.fr/about.php" />
<link rel="alternate" hreflang="es"
href="www.misitioweb.es/about.php" />
<link rel="alternate" hreflang="x-default"
href="http://www.mywebsite.com/about.php" />
</head>
Because this page says: "If two pages don't both point to each other, the tags will be ignored. This is so that someone on another site can't arbitrarily create a tag naming itself as an alternative version of one of your pages."
And in our case, it's not that "two pages" are pointing to each other, because it's only one page.
So... What's to proper way to do here?