views:

44

answers:

2

Hey

I have a bunch of domains on on of my servers. I'd like to be able to redirect some domains to a different domain without the user knowing, so not a 301 redirect.

An example, redirect domain.com to masterdomain.com/sites/domain.com. So when visiting domain.com, the user would be displayed with the data on masterdomain.com/sites/domain.com. Also masterdomain.com and domain.com are on the same server.

How could I do this using Apache? mod_rewritem mod_alias?

A: 

GoDaddy calls this a domain Alais.

Here is a link where it is explained

http://webwizardworks.com/web-design/domain-alias.html

codingguy3000
+1  A: 

If both host names use the same document root, you can do this:

RewriteCond %{HTTP_HOST} =example.com
RewriteRule !^sites/example\.com(/|$) sites/example.com%{REQUEST_URI} [L]

This rule will prepend /sites/example.com if the requested URI path does not already starts with that.

Gumbo
Unfortunately, host names are not in the same document root.
b2238488