用户
 找回密码
 入住 CI 中国社区
搜索
楼主: Hex
收起左侧

去掉 URL 中的 index.php

    [复制链接]
发表于 2008-3-29 16:27:22 | 显示全部楼层
哈哈。。对。。带着就与众不同了。。
 楼主| 发表于 2008-2-15 14:32:24 | 显示全部楼层
IIS 就不是这样了~~
有另外的 url rewrite 方法~~
不过,劝你还是用 apache。

PS: 不一定非要去掉 index.php 吧?带着没有什么不好,顶多就是不好看而已。
发表于 2008-2-15 14:03:17 | 显示全部楼层
谢谢楼上的回答,我使用的不是APACHE而是IIS,也是如上设置么?
 楼主| 发表于 2008-2-15 13:59:32 | 显示全部楼层
是的,但也需要根据你的目录情况进行修改!
具体你应该看看 apache rewrite 的相关手册!这是 apache 的问题,和 CI 没什么关系,呵呵~
发表于 2008-2-15 13:50:31 | 显示全部楼层
RewriteEngine on   
RewriteCond $1 !^(index.php|images|robots.txt)   
RewriteRule ^(.*)$ /index.php/$1 [L]

.htaccess这个文件中的代码就是以上三行么?
发表于 2008-1-15 20:19:10 | 显示全部楼层
补充一些我遇到的问题:
<Directory "D:/usr/local/www">
    AllowOverride all
    Options +FollowSymLinks +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
</Directory>
Options参数设置如上,好像不开,无法使用rewrite功能
心得:APACHE的LOGS一定要多看
 楼主| 发表于 2008-1-3 16:51:25 | 显示全部楼层
我修改了一下,顶上去。。。
 楼主| 发表于 2007-11-7 17:17:02 | 显示全部楼层
感谢楼上提供自己的设置!
发表于 2007-11-7 15:00:54 | 显示全部楼层
我用的
  1. <IfModule mod_rewrite.c>
  2.     RewriteEngine On
  3.     RewriteBase /my_dir/
  4.     RewriteCond %{REQUEST_FILENAME} !-f
  5.     RewriteCond %{REQUEST_FILENAME} !-d
  6.     RewriteRule ^(.*)$ index.php/$1 [L]
  7. </IfModule>

  8. <IfModule !mod_rewrite.c>
  9.     ErrorDocument 404 /index.php
  10. </IfModule>
复制代码

本版积分规则