Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Subdomain Issue


Reply

532 Views

Avatar
grumpypanda

26 May 2011 at 8:44am (Last edited: 26 May 2011 11:30am), Community Member, 32 Posts

Hi everyone,

I am working on a subdomains' issue, someone else (who has left) did the code for the site, so any help would be appreciated.

There is a "About Us" nav bar on the main website eg www.mainwebsite.com, and we would like the "About Us" to disappear for any subdomains eg xxx.mainwebsite.com.

I can see from the Silverstripe backend, there is a Hide in Subdomains function, and I ticked it. However, the "About Us" link disappears for some time and it comes back at other tomes on both main site and subdomains.

Can anybody point me to the right direction how can I fix this problem? I have found the code below if it is useful, and I can copy more code here if needed. Please help.

Thanks heaps,
S:)

   
function ShowMenuInSubdomain()
   {
      $host = explode('.',$_SERVER['HTTP_HOST']);
      $subdomain = $host[0];
      if($subdomain != 'www' && $this->HideInSubdomains) {
         return true;   
      }      
   }