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

[已解决] 关于CI伪静态301跳转问题

[复制链接]
发表于 2011-6-1 16:13:32 | 显示全部楼层 |阅读模式
我的apache规则如下

  1. [/font]
  2. [font=微软雅黑]RewriteEngine on
  3. RewriteBase /
  4. RewriteCond $1 !^(index\.php|favicon\.ico)
  5. RewriteRule ^(.*)$ index.php/$1 [L]

  6. #301跳转
  7. Options +FollowSymLinks
  8. RewriteCond %{HTTP_HOST}   !^www\.domain\.com$ [NC]
  9. RewriteCond %{HTTP_HOST}   !^$
  10. RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
  11. [/font]
  12. [font=微软雅黑]
复制代码




跳转都是正常的 但是输入 domain.com  之后他跳转的地址到了
www.domain.com/index.php/


为什么呢??? 希望高手能帮我解决一下! 灰常感谢
发表于 2011-6-1 17:17:43 | 显示全部楼层
  1. RewriteCond %{HTTP_HOST} ^domain\.com [NC]
  2. RewriteRule ^(.*) http://www\.domain\.com [R=301,L]
复制代码


把这个放到最前面,不要放到 CI 规则的后面。
 楼主| 发表于 2011-6-1 17:18:56 | 显示全部楼层
灰常感谢    微博这个东西真方便啊  带我去实验一下先
发表于 2012-8-17 21:00:51 | 显示全部楼层
256269683 PHP CI框架 CodeIgnite交流群

本版积分规则