收藏本站 Archiver
    请 后使用快捷导航
    没有账号?入住 CI 中国社区
    楼主: Hex

    去掉 URL 中的 index.php

    [复制链接]
    31
    发表于 2009年8月5日 17:41:32 | 只看该作者
    好贴,解决了我的问题!顶顶!
    32
    发表于 2009年8月8日 16:33:38 | 只看该作者
    解决问题了,谢谢大家~!
    33
    发表于 2009年8月11日 17:51:36 | 只看该作者
    CI 的 rewrite 这东西一般是这样写, 但是我也碰到不少,需要另外写法的 情况,
    34
    发表于 2009年8月31日 14:40:07 | 只看该作者
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond 1ドル !^(index\.php|images|js|css|robots\.txt)
    RewriteRule ^(.*)$ /CodeIgniter/index.php/1ドル[L]
    </IfModule>
    php info 也显示mod_rewrite
    35
    发表于 2009年8月31日 14:40:42 | 只看该作者
    但是URL 还是有index.php 这时怎么回事?
    36
    楼主| 发表于 2009年8月31日 15:49:10 | 只看该作者
    查看 apache 手册,这问题和 CI 无关,CI 没有 rewrite 一样可以使用。
    37
    发表于 2009年9月19日 12:26:39 | 只看该作者
    贴下,我的
    <IfModule mod_rewrite.c>
    <Files ~ "^.(htaccess|htpasswd)$">
    deny from all
    </Files>
    Options -Indexes
    Options +FollowSymLinks
    #允许解析文件中的SSI指令
    Options +Includes
    #定义404,500错误页面
    ErrorDocument 404 /404.htm
    ErrorDocument 500 /404.htm
    #定义目录索引页面
    DirectoryIndex index.php
    order deny,allow
    RewriteEngine on
    #设置根目录
    RewriteBase /np/
    #去掉链接地址中index.php字符串
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond 1ドル !^(index.php|images|robots\.txt)
    #RewriteCond 1ドル !^(index.php|images|robots\.txt)#排除的目录和文件类型
    RewriteRule ^(.*)$ index.php/1ドル [L]
    </IfModule>
    38
    发表于 2009年10月20日 10:21:29 | 只看该作者
    我都感觉不去也没什么不好吧!哈哈。。
    39
    发表于 2009年10月21日 15:28:02 | 只看该作者
    我用的
    姜运涛 发表于 2007年11月7日 15:00




    我用这个就OK。非常感谢啊!
    40
    发表于 2009年12月4日 06:54:31 | 只看该作者
    试验了好久,配置都不成功,有没有大虾能远程把那个我看看问题在哪里!
    下一页 »
    1 2 3 45 6 7 8 9 10 ... 13 下一页
    返回列表
    您需要登录后才可以回帖 登录 | 入住 CI 中国社区

    本版积分规则

    AltStyle によって変換されたページ (->オリジナル) /