CodeIgniter 查询字符串
首先,我必须指出,我不是程序员,也不想成为程序员,而且我所说的应用程序不是我编写的。我只是一个普通的最终用户,试图让事情像我需要的那样工作。话虽这么说,
两个简单的问题:
1.)为什么这样的 url 不适用于 codeigniter 支持的应用程序?
http://somesite.com/search?q=something
2.) 如何强制执行那样工作?
我已经阅读了至少两打关于这个问题的文章,但没有任何效果。我已经在配置文件中启用了 QueryStrings,我已将 url_protocol 更改为 PATH_INFO,我已将表单从 post 设置为 get,但没有任何效果。
帮助...
First of all I MUST point out that I am NOT a programmer, have NO desire to be a programmer, and the application i am speaking of was NOT written by me. I am just an average end user trying to make things work like I need them to work. That being said,
Two simple questions:
1.) Why will urls like this not work with codeigniter powered apps ?
http://somesite.com/search?q=something
2.) How do I force it to work like that ?
I have read atleast 2 dozen articles on the issue and NOTHING has worked. I have enabled QueryStrings in the config file, I have change the url_protocol to PATH_INFO, I have set my forms from post to get and NOTHING works.
HELP...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,尝试更改
$config['uri_protocol'] = "PATH INFO"; $config['uri_protocol'] = "REQUEST_URI";
如果这仍然不起作用,请检查您的
.htaccess
文件中是否有删除index.php
来自 URL;它将采用以下形式:如果此规则存在,请将最后一行更改为 `RewriteRule ^(.*)$ index.php/$1 [L]
注意,?从最后一行删除。
完成上述步骤后进行检查。希望这有效。
Ok, try changing
$config['uri_protocol'] = "PATH INFO"; to $config['uri_protocol'] = "REQUEST_URI";
If this still does not work, check your
.htaccess
file for a rule that removesindex.php
from URL; it will be of the form:If this rule exists, change the last line to `RewriteRule ^(.*)$ index.php/$1 [L]
Notice, the ? is removed from last line.
Check after doing above steps. Hope this works.