Api redirect issues

We are running DHIS 2.30 and it works fine when we browse using the IP address but if we use theURL address, it doesn’t display pages on the path http://url/api/*.
After troubleshooting, we discovered that the issue was with our domain name because it starts with “api…” so it is being misinterpreted and the redirect is done on the domain name not the /. . .
Any suggestion on resolving this problem without changing domain name?