开发者

Redirect from one domain to another, without the user realizing it

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?


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.


GoDaddy calls this a domain Alais.

Here is a link where it is explained

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜