As far as I know is not possible to do what you want to do.
OJS is able to answer to different domains, but one of them need to be the primary because all urls will be replaced by the base_url domain.
To make it clear, if you set your base_url to “public.es”, OJS will use this domain everywhere (nevermind where your entrypoint) and in the intranet, the ojs domain will still be “public.es”.
But sorry to ask but… why are you doing this?
I mean, looks like you are trying to solve in OJS a problem that is related with your network.
Easier solution would be open public.es in the intranet segment.