您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

为啥APACHE设置了多站点,重写模块就失效了

2024/12/15 15:08:00发布12次查看
为什么apache设置了多站点,重写模块就失效了?
就改了两个文件
重启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
#
# 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 block.
#
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
namevirtualhost *: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

------解决方案--------------------
options followsymlinks execcgi indexes
    allowoverride none
    order deny,allow
    deny from all
    satisfy all
改为:
options followsymlinks execcgi indexes
    allowoverride none
    order allow,deny
    allow from all
------解决方案--------------------
内容太多,又没重点,不细看了。估计没有大错
需要注意以下几点
重写是针对网站,所以每个网站都应有自己的重写规则
如果主网站没有停用的话,那么虚拟主机列表中的第一个,就等同于主站
此时主站也有 .htaccess 的话,可能造成路由中出现环或指向失败
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product