![]() |
|
|||||||
| 服务器环境搭建 Windows,Linux,IIS,Apache等服务器配置、安全维护以及PHP和MYSQL运行环境讨论。 |
|
|
Thread Tools | Display Modes |
|
#5
IP: 117.95.53.152
|
|||
|
|||
|
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
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/. |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|