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

[版本 3.x] 怎么讲 query string 转换为分段URL?

[复制链接]
发表于 2016-5-5 19:32:29 | 显示全部楼层 |阅读模式
我现在的网站的 URL 类型是 :
http://www.example.com/index.php?c=controller&m=function

这样的,我想改成:

http://www.example.com/index.php/controller/function


并且还得保证 http://www.example.com/index.php?c=controller&m=function 这种的链接还能正常访问,求解?


发表于 2016-5-6 18:43:54 | 显示全部楼层
config.php中将$config['uri_protocol']  改为 'PATH_INFO',然后再使用site_url的时候即可生成http://www.example.com/index.php/controller/function 这种形式的url了

本版积分规则