简体   繁体   中英

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.

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. 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.

The website is based on 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. 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 . This link also will help you https://docs.joomla.org/Multiple_Domains_and_Web_Sites_in_a_single_Joomla!_installation .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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