PHP:在子域的多语种网站W / O型的public_html的多个副本 [英] PHP: multilingual website on subdomains w/o many copies of public_html
问题描述
我有一个多语言(11种语言)的网站。现在,它使用的语言得到的参数或一个cookie作品选语言。现在我想使用子域名来代替饼干和获取参数。但我不希望让网站11为每个子域完整副本(发动机和一些静态的东西)。是否有可能把一些PHP和htaccess的code(一个非常小的一块)到每个子域的根目录下,这样的网站的发动机之类的东西只有一个拷贝将被用于11子域。谢谢你。
I have a multilingual (11 languages) website. Right now it works chooses language using 'language' get parameter or a cookie. Now I want to use subdomains instead of cookies and get parameter. But I do not want to make 11 complete copies of website (engine and some static stuff) for each subdomain. Is it possible to place some php and htaccess code (a very little piece) into each subdomain's root catalog, so only one copy of website's engine and stuff will be used by 11 subdomains. Thanks.
推荐答案
我说来配置你的Apache指向所有的虚拟主机以相同的文件夹,然后使用的 $ _ SERVER [SERVER_NAME] 找出被要求什么子域。
I'd say to configure your Apache to point all your virtual hosts to the same folder, then use $_SERVER["SERVER_NAME"] to figure out what subdomain was requested.
这篇关于PHP:在子域的多语种网站W / O型的public_html的多个副本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!