make the same code work in sub-uris in prod as works in dev