In Drupal 7 I am using the Domain module to allow multiple subdomains of the format sub1.example.com, sub2.example.com, etc.
When I am sure that I can correctly identify the current subdomain, I will use a php test in the Block Visibility Settings to decide which menu to show to which subdomain.
To check I can use PHP to identify the current subdomain, I have set up a block with the code.
global $base_url; $current_path = $base_url . '/' . current_path(); echo $base_url; echo "<br>"; echo $current_path; echo "<br>"; $actual_link = "$_SERVER[HTTP_HOST] $_SERVER[REQUEST_URI]"; echo $actual_link;
The result shows the subdomain from the first page that I access. When I switch page to another subdomain the new subdomain is not shown; the original one is still shown.
How can I can see the correct subdomain for the current page?