I have a multi-site; each site has its own database but they all share the same codebase. I would like to know if there is a way to define hook_menu()
paths at specific base URLs.
Being it a multisite, I have created a common module used by all the sites. I wanted something like this in hook_menu()
.
if (base_url == 'wmc.en') {
$items['wmc/contact-us'] = array('hook menu stuffs');
}
if (base_url == 'gmc.es') {
$items['gmc/contact-us'] = array('hook menu stuffs');
}
I tried this type of code, but hook_menu()
doesn't seem to recognize base_url
or $_SERVER['SERVER_NAME']
.
Is it possible to achieve what I am trying to do?