【发布时间】:2015-01-08 22:57:12
【问题描述】:
我正在将 CodeIgniter 框架与 .htaccess 命令一起用于“漂亮的 url”。
RewriteCond $1 !^(index\.php|assets|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ /index.php?$1 [L]
所有网址,例如:
-
example.com/admin/xxx/ - 传递为 ->
example.com/index.php?admin/xxx/(看起来像 CodeIgniter 的?/class/method/)
但问题是:我怎样才能传递$_GET 参数?例如:
-
example.com/admin/xxx/?action=die&time=now
我需要使用 GET 参数和外部 ajax 脚本(例如:基于 CODEIGNTER 的 ElFinder)
感谢您的建议
编辑:
我在 Elfinder 使用 POST 方法解决了这个问题:
Elfinder - Request type
但是顺便说一句,在带有标记“?”的代码点火器中使用 $_GET 参数。有了这个.htaccess,是不可能的
【问题讨论】:
-
检查 CodeIgniter 的
Inputclass 和配置文件中的$config['allow_get_array]设置。
标签: php .htaccess codeigniter mod-rewrite