2

I have a company ABC and I registered ABC domains in different countries.

I have developed www.abc.com website and this main site has many languages subfolders:

www.abc.com/en with hreflang=en (lang=english, geotargeting=none)

www.abc.com/fr with hreflang=fr (lang=french, geotargeting=none)

www.abc.com/es with hreflang=es (lang=spanish, geotargeting=none)

etc.

for each subfolder, the right language file is loaded with the static content.

Now I have other ccTLDs:

www.abc.fr with hreflang=fr-FR (lang=french, geotargeting=France)

www.abc.es with hreflang=es-ES (lang=spanish, geotargeting=spain)

www.abc.com with hreflang=en-US (lang=english, geotargeting=united states)

etc.

Each country TLD-site has same language hyperlinks pointing to the generic site www.abc.com/xx xx=lang code.

All sites are implemented in PHP accessing the SAME MySQL DB displaying the dynamic content.

In order to minimize the maintenance costs, I'd need all domains to refer the same subset of common files, only some files are specific to one ccTLD (ex: .css file).When a user types www.abc.es the Spanish language is set, the CSS is set (for ex.) and www.abc.es address loads the common subset of files and displays basically the same content as www.abc.com/es.

So, finally my question is: should .htaccess be used to make this implementation? What are the main commands? Is there an alternative way to implement this?

Danny Beckett
  • 20,529
  • 24
  • 107
  • 134

1 Answers1

0

You can just set up the ccTLDs with a single page that loads your main site subpage with URL masking. I'm thinking about echoing file_get_contents(ccTLC). This means that on abc.fr, you're actually loading abc.com/fr, even though the URL is abc.fr.

<?php
    echo file_get_contents('http://www.abc.com/fr/'); //for abc.fr, obviously
?>

This is a very easy solution, but won't mask URLs after you leave abc.fr. If you click a link there, you'll be taken to the page on abc.com/fr/.

If you want to mask an entire site (like domain parking), you'll need something a little more complex, like a PHP masking function or .htaccess. .htaccess is the best choice in my opinion for masking the entire site. For using .htaccess to do this, look at Use htaccess to mask domain and folder name

Community
  • 1
  • 1
ndm13
  • 1,189
  • 13
  • 19