就改了两个文件
重启apache以后显示403Forbidden (这是预期的,因为根目录下没有index.php,真正的首页在其他文件夹里,通过重写url访问)
【httpd-vhosts.conf】
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot E:\mcmod\www
ServerName dummy-host.appservnetwork.com
ServerAlias www.dummy-host.appservnetwork.com
ErrorLog logs/dummy-host.appservnetwork.com-error_log
CustomLog logs/dummy-host.appservnetwork.com-access_log common
</VirtualHost>
NameVirtualHost *:90
<VirtualHost *:90>
ServerAdmin [email protected]
DocumentRoot E:\mcmod\video
ServerName dummy-host2.appservnetwork.com
ErrorLog logs/dummy-host2.appservnetwork.com-error_log
CustomLog logs/dummy-host2.appservnetwork.com-access_log common
</VirtualHost>
------解决方案--------------------
<Directory />
Options FollowSymLinks ExecCGI Indexes
AllowOverride None
Order deny,allow
Deny from all
Satisfy all
</Directory>
改为:
<Directory />
Options FollowSymLinks ExecCGI Indexes
AllowOverride None
Order allow,deny
Allow from all
</Directory>
------解决方案--------------------
内容太多,又没重点,不细看了。估计没有大错
需要注意以下几点
重写是针对网站,所以每个网站都应有自己的重写规则
如果主网站没有停用的话,那么虚拟主机列表中的第一个,就等同于主站
此时主站也有 .htaccess 的话,可能造成路由中出现环或指向失败