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

[HELP] 给ci 项目写 .htaccess 规则 隐藏index.php同时实现统一URL

[复制链接]
发表于 2012-12-2 13:54:32 | 显示全部楼层 |阅读模式
隐藏 index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|statics|robots\.txt|error\.png)
RewriteRule ^(.*)$ /index.php/$1 [L]
强制url 尾部加/

<IfModule mod_rewrite.c> RewriteCond %{REQUEST_URI} /+[^\.]+$ RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]</IfModule>
自动加上www
RewriteCond %{http_host} ^xx.com [NC]
RewriteRule ^(.*)$ http://www.xx.com/$1 [R=301,L]
怎么把三个统一 起来 我没试成功,请大家帮忙看下!
发表于 2012-12-2 15:00:18 | 显示全部楼层
伟哥v5
发表于 2012-12-3 17:57:55 | 显示全部楼层
我对不起你啊。  wei哥  {:soso_e109:} ,晚上我搞搞。

本版积分规则