2

I have a domain (in the firm A) that goes to an IP (in the firm B). When write my domain in a browser it shows then the IP instead of the domain.

How can i show always the domain instead of the IP?

I'm using apache as web server.

Javi

1
  • That should be on superuser.com, and also it is vague... voting to close
    – t0mm13b
    Sep 8, 2010 at 19:34

2 Answers 2

1

If your site shows when requesting via IP, you can do url redirecting via mod_rewrite. If that's not the case, which means the host apache configuration has multiple sites hosted on the same IP, you can't do this, because this won't be your own IP, but will be shared among all domains on the server

1
  • If you are using mod_rewrite, then you may be better off achieveing this in DNS. There is no reason why you can't resolve a name (e.g. application.firma.com) to an IP address in someone else's network. That way, your address bar would show the domain name instead of the IP. It'll also be cleaner if you ever need to move the site away from the firm B server later. Sep 8, 2010 at 20:26
0

Check

ServerName and ServerAlias

directives in your config. My guess is that ServerName contains the IP address and non-canonical urls, i.e. htp://domain.com/dirname are rewritten to htp://1.2.3.4/dirname which might be what is causing your rewrite.

Url sufficiently mucked up due to the fact that I can't seem to figure out how to turn off the markup.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .