Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.


share|improve this question

migrated from Sep 8 '10 at 20:02

This question came from our site for professional and enthusiast programmers.

That should be on, and also it is vague... voting to close – t0mm13b Sep 8 '10 at 19:34
up vote 1 down vote accepted

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

share|improve this answer
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. 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. – Mitch Miller Sep 8 '10 at 20:26


ServerName and ServerAlias

directives in your config. My guess is that ServerName contains the IP address and non-canonical urls, i.e. htp:// are rewritten to htp:// 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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.