【发布时间】:2011-02-27 18:55:54
【问题描述】:
我已经从我的 url 中删除了 index.php,但现在我需要从 url 中获取一些变量,CI 解决方案是更新 config.php
$config['uri_protocol'] = "PATH_INFO";
$config['enable_query_strings'] = TRUE;
当我在 url 中使用 index.php 时,这可以完美地工作,但我需要它而不需要 index.php
这是我的httacess
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA
任何解决方案? ,谢谢
【问题讨论】:
-
您尝试过
$var = $this->uri->segment(3),其中 3 是您想要的分段吗? -
是的,但是 url 来自 facebook sdk 的问题,例如:mydomaine.com/fb/index/… 如果我删除“?”它与 uri->segment ... 一起使用。但是现在它显示404屏幕,我认为用CI创建一个fb APP是个坏主意:(
标签: .htaccess codeigniter url-rewriting codeigniter-url