Ideally you would update enable_presence_by_hs_url work based on the homeserver name instead of the client URL.