Multisite domain path access control E.g. My site have two subdomains : domain_a and domain_b.

I create a path: "custom/a".

I hope:

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?
There's a few ways to do that, but an easy one is to use the Panels module to define the page, coupled with domain_ctools

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.