View Single Post
  #2   IP: 117.95.53.152
Old 2009-05-16, 11:31 AM
topvip topvip is offline
超级版主
 
Join Date: 2006-01-04
Posts: 1206
topvip 正向着好的方向发展
Default

If you want a Domain Alias to redirect and put the correct hostname in
the URL bar of the browser, you can use mod_rewrite. If you are hosting
original.com and have a domain alias of alias.com and you want all
requests for alias.com urls to be redirected back to original.com urls,
then you would put this in an .htaccess file in any directory where you
want this redirection to happen:

Code:
RewriteEngine on
   RewriteCond %{HTTP_HOST} alias.com$   [NC] 
   RewriteRule ^(.*)$  http://www.original.com/$1   [R]
The rule will affect all directories below the one where you put this
.htaccess file. So a request for http://www.alias.com/docs/services.html
will be redirected to http://www.original.com/docs/services.html as
well.
Reply With Quote