Jump to:

23355 Posts in 17873 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » Subdomain Issue

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

Page: 1
Go to End
Author Topic: 507 Views
  • grumpypanda
    Community Member
    32 Posts

    Subdomain Issue Link to this post

    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,

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

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.