用户
 找回密码
 入住 CI 中国社区
搜索
查看: 3727|回复: 3
收起左侧

[讨论/交流] ci和apache的伪静态写法

[复制链接]
发表于 2012-4-13 13:10:49 | 显示全部楼层 |阅读模式
我的.htaccess 文件
RewriteEngine On
RewriteBase   /
RewriteRule ^work/show-(\d+)\.html$ /index.php/work/index?id=$1 [L]

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

但是执行时却提示ci的404信息?
有谁能帮我解决这个问题啊?
发表于 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 [L]

本版积分规则