Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

migrated from stackoverflow.com Sep 8 '10 at 20:02

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

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

2 Answers 2

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

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.

share|improve this answer

Your Answer

 
discard

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.