We're planning on translating our website in 8 other languages. To avoid having to upload tons of copies of our website when something changes, we use the same page for all languages, and simply echo the desired language text using PHP:
<?php
$language = $_GET['lang'];
echo $text['text_id'][$language];
?>
But we don't want to handle the different languages using for example ?lang=en
at the end of the URL. The main reason is because we want to use country-specific domain names (and Google doesn't recommend using URL parameters for multi-regional sites).
In the first stage, every country-specific domain will have only one language: the main language of that country.
So my question is: can I use the same pages even when using different domain names? Ideally, it would be something like this:
mywebsite.co.uk ---> loads the page with language code "en".
monsiteinternet.fr --> loads the page with language code "fr".
Of course, all other folders etc. need to continue working. For example, when navigating on the first website, you could end op on a page called: mywebsite.co.uk/somedir/somepagename.php
. Navigating on the second site should result in monsiteinternet.fr/somedir/somepagename.php
. somepagename.php
being the exact same page on the server.
Is something like that possible? If so, how would this work? Or do I need to upload an updated page at least 8 times, one for every language?