简体   繁体   English

如何在Joomla网站中根据域名选择首页

[英]How to make the choice of front page depending on domain name in Joomla website

I have a website, let's call it mydomain.com, hosted by host provide Siteground. 我有一个网站,我们称其为mydomain.com,由主机提供商Siteground托管。

I have created a subdomain, let's call it sub.mydomain.com, and I have set the root folder of the subdomain the same as the main domain. 我已经创建了一个子域,我们称其为sub.mydomain.com,并将子域的根文件夹设置为与主域相同。 As a result, the subdomain shows the same contents, in every of its pages, as the main domain. 结果,子域在其每个页面中都显示与主域相同的内容。

Now I would like to have a different home page for the main domain and for the subdomain. 现在,我想为主域和子域创建一个不同的主页。

So I wish write a php code (maybe in the index.php of the root folder), so that, depending on the value of the current domain name ("mydomain.com" or "sub.mydomain.com"), the default home menu is set accordingly. 因此,我希望编写一个php代码(也许在根文件夹的index.php中),以便根据当前域名的值(“ mydomain.com”或“ sub.mydomain.com”),默认主菜单已相应设置。

The website is based on Joomla 2.5 该网站基于Joomla 2.5

You can use Virtual domains a joomla extension which can help you to have different templates and content for your demo site. 您可以使用joomla扩展虚拟域,该扩展可以帮助您为演示站点提供不同的模板和内容。 You dont need to hack any core files. 您不需要破解任何核心文件。 As it will be difficult for you to update later. 因为您以后很难更新。 The link is http://extensions.joomla.org/extension/virtual-domains . 链接是http://extensions.joomla.org/extension/virtual-domains This link also will help you https://docs.joomla.org/Multiple_Domains_and_Web_Sites_in_a_single_Joomla!_installation . 此链接还将帮助您https://docs.joomla.org/Multiple_Domains_and_Web_Sites_in_a_single_Joomla!_installation

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM