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

php中文网
发布: 2016-06-13 12:01:43
原创
1122人浏览过

为什么APACHE设置了多站点,重写模块就失效了?
就改了两个文件
重启apache以后显示403Forbidden (这是预期的,因为根目录下没有index.php,真正的首页在其他文件夹里,通过重写url访问)

【httpd-vhosts.conf】

<br />#<br /># Virtual Hosts<br />#<br /># If you want to maintain multiple domains/hostnames on your<br /># machine you can setup VirtualHost containers for them. Most configurations<br /># use only name-based virtual hosts so the server doesn't need to worry about<br /># IP addresses. This is indicated by the asterisks in the directives below.<br />#<br /># Please see the documentation at <br /># <URL:http://httpd.apache.org/docs/2.2/vhosts/><br /># for further details before you try to setup virtual hosts.<br />#<br /># You may use the command line option '-S' to verify your virtual host<br /># configuration.<br /><br />#<br /># Use name-based virtual hosting.<br />#<br />NameVirtualHost *:80<br /><br />#<br /># VirtualHost example:<br /># Almost any Apache directive may go into a VirtualHost container.<br /># The first VirtualHost section is used for all requests that do not<br /># match a ServerName or ServerAlias in any <VirtualHost> block.<br />#<br /><VirtualHost *:80><br />    ServerAdmin [email&#160;protected]<br />    DocumentRoot E:\mcmod\www<br />    ServerName dummy-host.appservnetwork.com<br />    ServerAlias www.dummy-host.appservnetwork.com<br />    ErrorLog logs/dummy-host.appservnetwork.com-error_log<br />    CustomLog logs/dummy-host.appservnetwork.com-access_log common<br /></VirtualHost><br /><br />NameVirtualHost *:90<br /><br /><VirtualHost *:90><br />    ServerAdmin [email&#160;protected]<br />    DocumentRoot E:\mcmod\video<br />    ServerName dummy-host2.appservnetwork.com<br />    ErrorLog logs/dummy-host2.appservnetwork.com-error_log<br />    CustomLog logs/dummy-host2.appservnetwork.com-access_log common<br /></VirtualHost>
登录后复制

------解决方案--------------------

    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 的话,可能造成路由中出现环或指向失败

最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号