I want to make website in multiple languages, I do it right with cookies to detect the user preferred language.
Now I want to make each language has its sub-domain to be indexed in search engines, some thing like Facebook.
so I want to configure my Apache to point all my virtual hosts to the same folder, then use $_SERVER["SERVER_NAME"] to figure out what sub-domain was requested.
I start to use this code in my htaccess file:
<VirtualHost *>
ServerName mydomain.com
ServerAlias en.mydomain.com ar.mydomain.com es.mydomain.com
</VirtualHost>
but it doesn't work and I get cannot find server when I request es.mydomain.come so any help ?
BTW I use mod_rewrite after that code above! and I didn't create any sub-domain in cPanel!