开发者

Multiple domains for different language, best way to arrange?

开发者 https://www.devze.com 2023-01-30 21:56 出处:网络
I have a site (let\'s call it finnish.com). I bought another domain, english.com. The idea is to have multilingual website. The sites are exactly same, but they obiously need language-specific informa

I have a site (let's call it finnish.com). I bought another domain, english.com. The idea is to have multilingual website. The sites are exactly same, but they obiously need language-specific information. I'm currently looking for t开发者_StackOverflowhe best way to do this. Probably it's htaccess. This is what I've tried:

RewriteEngine On
RewriteRule header.php$ header.php?lang=en [L]

However, this works as I manually visit header.php (which has the language-specific details), but if I include it through php, it doesn't work.

It would best, if selected files (no need to be dynamic; can be listed manually) would have a $_GET-attribute on another domain.

Any ideas?

Martti Laine


I'm not sure whether it's what you need, but why not use $_SERVER["HTTP_HOST"] to find out which domain the file is addressed under? Then you could switch languages automatically.

0

精彩评论

暂无评论...
验证码 换一张
取 消