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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

Subdomain Issue


Go to End


827 Views

Avatar
grumpypanda

Community Member, 32 Posts

26 May 2011 at 8:44am

Edited: 26/05/2011 11:30am

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;
}
}