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

If abc.com is your original domain and xyz.com is the domain alias, and
you want people going to abc.com to see one site and people going to
xyz.com to see a different site, and you want the hostname to stay as
the user typed it, make a directory called xyz under /htdocs/www and put
the xyz.com website in it. Then use mod_rewrite in an .htaccess file in
/htdocs/www

Code:
RewriteEngine On
  RewriteCond %{HTTP_HOST}  xyz.com$ [NC]
  RewriteCond %{REQUEST_URI} !^/xyz/.*$
  RewriteRule ^(.*)$  /xyz/$1
Now when people go to abc.com they will see the site in /htdocs/www.
When people go to xyz.com, they will be served pages from
/htdocs/www/xyz and the URL in their browser will not change the
hostname or show them the /xyz/.
Reply With Quote