E.g. My site have two subdomains : domain_a and domain_b.
I create a path: "custom/a".
domain_a can visit the path.
domain_b visit the path, get 404.
Except according to the
golbal $domain in the code, does anyone have other solution?
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.Sign up to join this community
Then you can just add a selection rule or access control rule to specify the valid domains via the user interface.
Alternatively, you could do something with hook_menu access callbacks.