O(∩_∩)O莔 发表于 2012-4-13 13:10:49

ci和apache的伪静态写法

我的.htaccess 文件
RewriteEngine On
RewriteBase   /
RewriteRule ^work/show-(\d+)\.html$ /index.php/work/index?id=$1

想实现http://localhost:8090/work/show-9443.html重写到http://localhost:8090/index.php/work/index.html?id=9443上

但是执行时却提示ci的404信息?
有谁能帮我解决这个问题啊?

evan2884 发表于 2012-5-16 13:19:17

再这个配置文件里去设置
application/config/routes.php
参考:http://codeigniter.org.cn/user_guide/general/routing.html

交朋友 发表于 2012-7-9 18:19:48

没看明白啊,直接用apache的url重写也不行啊,nginx都没问题,晕了

大道达人 发表于 2012-7-10 09:02:27

你的规则少了 '.html'了吧
RewriteRule ^work/show-(\d+)\.html$ index.php/work/index.html?id=$1
页: [1]
查看完整版本: ci和apache的伪静态写法