日期:2014-05-16 浏览次数:21081 次
<VirtualHost m.witmax.cn:80> ServerAdmin tempgame@hotmail.com DocumentRoot D:/wwwroot/subdir ServerName m.witmax.cn ErrorLog logs/m-error_log.txt CustomLog logs/m_log.txt common </VirtualHost>
RewriteEngine on # 把 m.witmax.cn 改为你要绑定的域名. RewriteCond %{HTTP_HOST} ^(www.)?m.witmax.cn$ # 把 subdir 改为要绑定的目录. RewriteCond %{REQUEST_URI} !^/subdir/ # 不要改以下两行. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # 把 subdir 改为要绑定的目录. RewriteRule ^(.*)$ /subdir/$1 # 把 m.witmax.cn 改为你要绑定的域名 # 把 subdir 改为要绑定的目录. # subdir/ 后面是首页文件index.php, index.html…… RewriteCond %{HTTP_HOST} ^(www.)?m.witmax.cn$ RewriteRule ^(/)?$ subdir/index.php [L]
NameVirtualHost *:80 //就是因为没有加这个NameVirtualHost才出现那个情况,引以为戒 <VirtualHost a.com:80> ServerAdmin lx.xin@qq.com DocumentRoot c:/wamp/www/a ServerName a.com ErrorLog logs/a_log.txt CustomLog logs/a_log.txt common </VirtualHost> <VirtualHost b.com:80> ServerAdmin lx.xin@qq.com DocumentRoot c:/wamp/www/b ServerName b.com ErrorLog logs/b_log.txt CustomLog logs/b_log.txt common </VirtualHost> <VirtualHost c:80> ServerAdmin lx.xin@qq.com DocumentRoot c:/wamp/www/c ServerName c.com ErrorLog logs/c_log.txt CustomLog logs/c_log.txt common </VirtualHost>