【问题标题】:Codeigniter redirect() adds a question mark in the URLCodeigniter redirect() 在 URL 中添加问号
【发布时间】:2016-03-18 20:29:39
【问题描述】:

我在我的网络应用程序中使用 CI 的 redirect() 函数,redirect() 在 url 中添加了一个问号,这导致了一个问题,我无法修复它。尝试编辑 htaccess 代码,但没有运气。

感谢大家的帮助,TIA

【问题讨论】:

标签: .htaccess codeigniter redirect


【解决方案1】:

检查 config.php,如果 enable_query_strings = true 你会有 ?在网址中。应该是:

$config['enable_query_strings'] = false;

【讨论】:

  • 即使没有 GET 数据,你确定这会强制? 吗?
  • 如何使用重定向功能?发布您的代码?
  • 好吧,我现在需要 $config['enable_query_strings'] = true; ..如何解决?问题我这种情况...
【解决方案2】:

这将解决在 codeigniter 3.01 中为 site_url 函数添加问号

RewriteEngine On
RewriteBase /foldername/  
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA,NC]

【讨论】:

    猜你喜欢
    • 2017-12-25
    • 2012-07-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-29
    • 2013-07-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多