Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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'm trying to get and to point to the same DocumentRoot, without the domain changing in the browser url. Is that possible with Apache?

I've got the both domains pointing to the same DocumentRoot and working, but the changes to in the browser url.

share|improve this question
up vote 1 down vote accepted

Use a Redirect to within the VirtualHost for For this to work mod_alias must be loaded.

        RedirectMatch (.*)

You could also specify any standard VirtualHost settings desired, such as CustomLog.

share|improve this answer
Thank you. That seemed to fix the url problem, but I forgot to tell that the server uses https protocol only, so now the browser warns about an untrusted ssl certificate.. (naturally because the .com url has now the .fi certificate) I'm just trying to get the two domains to point to the same DocumentRoot and work with ssl, but is it possible? – Jukka Mar 26 '10 at 22:16
Are you linking the different URL within your site? I don't understand why the Redirect would introduce a SSL error. I need more details. What's the actual domain? – Warner Mar 26 '10 at 22:26
No, I'm not linking the URLs. I just need the site to work with both domains when users visit them. I can't tell the actual domain yet, because it hasn't been published yet.. The SSL error comes with the URL but not with Our and have different SSL sertificates. – Jukka Mar 26 '10 at 22:39
You should be able to setup a https vhost for and redirect it to If the CN in the cert matches both vhosts, you shouldn't get SSL errors. – Warner Mar 27 '10 at 3:35
The CN only matches one vhost. If we would buy a cert that matches both domains, it would cost a lot more.. So I guess for now we can only use one domain, and just redirect from .fi to .com domain. Thanks for your help. – Jukka Mar 28 '10 at 11:44

Your Answer


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