I have a customer who wants his domain to开发者_JAVA百科 be redirected to some other site. For example:
www.hisdomaine.com => www.him.somewysiwyghost.com
the redirection should be transparent so www.hisdomain.com/somefolder should translate to www.him.somesysiwyghost.com/somefolder
important to him is, www.him.somewysiwyghost.com should never be visible to the user. the user should see www.hisdomain.com. because of this frames aren't an option. also frames are not the best options for SEO.
I tried using mod_rewrite for this, using this rule:
RewriteRule (.*) http://www.him.somewysiwyghost.com/$1 [L]
It works fine, except the URI translates to www.him.somewysiwyghost.com so the user could see it. How could I translate invisibly?
You should use mod_proxy as such in a vhost:
<VirtualHost *:80>
ServerName hisdomaine.com
ServerAlias www.hisdomaine.com
ProxyPass / http://www.him.somesysiwyghost.com
ProxyPassReverse / http://www.him.somesysiwyghost.com
ProxyPreserveHost On
<Location />
Order allow,deny
Allow from all
</Location>
</VirtualHost>
In that case I think you have to transfer the domain on the other server and park it. I don't think that you can do something like that via .htaccess
.
Another solution, but not so good is to use a full screen iFrame to display the other site.
精彩评论