apache的rewrite规则无法加载问题。

<VirtualHost *:80>

ServerAdmin k@5.com

DocumentRoot /data/web/xxx

ServerName  www.xxx.net

ServerAlias xxx.net

DirectoryIndex index.php index.shtml index.html

<Directory "/data/web/xxx">

Options FollowSymLinks Includes

AllowOverride None

Order allow,deny

Allow from all

</Directory>

RewriteEngine On

RewriteRule ^vod-(.*)$ index.php\?s=/Home-vod-$1

RewriteRule ^news-(.*)$ index.php\?s=/Home-news-$1

RewriteRule ^ajax-(.*)$ index.php\?s=/Home-ajax-$1

RewriteRule ^tag-(.*)$ index.php\?s=/Home-tag-$1

RewriteRule ^gb-(.*)$ index.php\?s=/Home-gb-$1

RewriteRule ^cm-(.*)$ index.php\?s=/Home-cm-$1

</VirtualHost>

改成
<VirtualHost *:80>
ServerAdmin k@5.com
DocumentRoot /data/web/xxx
ServerName  www.xxx.net
ServerAlias xxx.net
DirectoryIndex index.php index.shtml index.html
<Directory "/data/web/xxx">
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>
RewriteEngine On
RewriteRule ^vod-(.*)$ index.php\?s=/Home-vod-$1
RewriteRule ^news-(.*)$ index.php\?s=/Home-news-$1
RewriteRule ^ajax-(.*)$ index.php\?s=/Home-ajax-$1
RewriteRule ^tag-(.*)$ index.php\?s=/Home-tag-$1
RewriteRule ^gb-(.*)$ index.php\?s=/Home-gb-$1
RewriteRule ^cm-(.*)$ index.php\?s=/Home-cm-$1
</VirtualHost>

即可。
区别在于

<Directory "/data/web/xxx">

Options FollowSymLinks Includes

AllowOverride None

Order allow,deny

Allow from all

</Directory>

<Directory "/data/web/xxx">
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>
这个为正确的。
参考 http://www.d5s.cn/archives/107

本文转自 liang3391 51CTO博客,原文链接:http://blog.51cto.com/liang3391/812280

apache的rewrite规则无法加载问题相关推荐

  1. Apache的Rewrite规则详细介绍

    rewrite是一种服务器的重写脉冲技术,它可以使得服务器可以支持 URL 重写,是一种最新流行的服务器技术.它还可以实现限制特定IP访问网站的功能. 工具/原料 Apache 方法/步骤 Rewri ...

  2. IIS8.5安装urlrewrite2.0 后C:\Windows\system32\inetsrv\rewrite.dll 不能加载

    现象 安装URL Rewrite 2.0之后出现Service Unavailable 503 error,伴随着应用程序池自动停止,同时查看事件日志,发现C:\WINDOWS\system32\in ...

  3. 编译安装apache2.2对应的mod_proxy_fcgi.so模块步骤,apache进行fcgi通信需要加载该模块

    编译安装apache2.2对应的mod_proxy_fcgi.so模块步骤,因为使用apache--phpfpm 需要这个 #mod-proxy-fcgi-master 模块步骤 [root@iZ25 ...

  4. php rewrite 规则,Apache RewriteCond ReWrite规则

    Apache通过RewriteCond设置ReWrite规则,可以在httpd.conf配置文件中直接设置rewrite规则,也可以根据需要在网站的.htaccess文件中设置rewrite规则. R ...

  5. nginx之rewrite规则未加引号导致检查nginx语法报错

    在nginx的站点配置文件中使用了rewrite,检查rewrite规则确定是没问题,但是在rewrite中带有"{}"时,此时检查nginx语法报错 rewrite规则: [ro ...

  6. apache的rewrite规则来实现URL末尾是否带斜杠

    1.url: http://www.test.com/user/ 跟:http://www.test.com/user 这两个URL对于用户来说应该是一样的,但从编程的角度来说,它们可以不相同 但我们 ...

  7. 如何在Apache环境下配置Rewrite规则

    原文链接:http://faq.comsenz.com/viewnews-12 URL 静态化是一个利于搜索引擎的设置,通过 URL 静态化,达到原来是动态的 PHP 页面转换为静态化的 HTML 页 ...

  8. IIS配置反向代理URL rewrite.dll加载失败

    更新 2022年10月9日17:58:33更新: 不要尝试了,以下方法只能转发静态资源,不能转发接口数据. 环境 Windows Server 2012R2 + IIS8.5 + URL Rewrit ...

  9. 报警系统QuickAlarm之报警规则的设定与加载

    前面一篇是报警执行器的定义与加载已经完成,但与之对应的报警规则有是如何定义和加载的呢? 此外,既然命名为规则,那么就需要有对应的解析器,以根据报警规则和报警类型等相关输入条件,来选择对应的报警执行器, ...

最新文章

  1. 14 个实用的数据库设计技巧,一次性教给你!
  2. linux user 用户管理
  3. python 入门第六课 class面向对象OOP
  4. ShardedJedisPool 中可用连接数的小bug
  5. git .gitignore 忽略的文件还会被提交
  6. 由“美图秀秀”软件的网站,看网站的生存模式
  7. python/sklearn 生成分类、回归的数据
  8. 舒服的网页登录界面设计灵感
  9. php获取当前域名、主机、URL、端口、参数、网址、路径、代理等
  10. html阶梯统计,html,_有什么图表可以显示阶梯费率,html - phpStudy
  11. Iterm2 配置(不断更新)
  12. 小程序页面转pdf时如何实现自动分页
  13. win10怎么修复网络连接服务器失败,微软发布修复补丁修复Win10无网络连接问题...
  14. 【读书笔记】向上-张自豪:清华学霸的成长之路
  15. CSS基础:浅用字体图标(以阿里字体图标库演示)
  16. 这样吃橙子才最健康,90%的人不知道的秘密!
  17. 配置故障转移群集,livemigration系列之七
  18. 雷军赞赏有加,黑鲨游戏手机2打造“操控之王”
  19. BUUCTF_Crypto_[MRCTF2020]天干地支+甲子
  20. rd,pe,ae,fae,marketing,sales都是干嘛的?

热门文章

  1. Android高效加载大图、多图解决方案_LruCache,有效避免程序OOM
  2. Java---形参个数可变的方法
  3. python -asyncio
  4. kotlin中学习笔记——null
  5. bulid-tool
  6. 关于setTimeout
  7. 通过Url网络编程实现下载
  8. [转载]JAVA实现鼠标右键功能
  9. [转] 程序员面试题精选100题(35)-找出两个链表的第一个公共结点
  10. Michael Nygard on Building Resilient Systems