codeigniter 查询字符串和分段在一起
在我的项目中,我需要查询字符串功能和段数组功能。因为有些返回url是查询字符串的形式。 我进行了以下更改,但没有成功。
我的 config.php 看起来像
$config['base_url'] = '';
$config['uri_protocol'] = 'PATH_INFO';
$config['enable_query_strings'] = TRUE;
我的 .htaccess 文件是
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^$ /test/index.php [L]
RewriteCond $1 !^(index\.php|resource|smsprinter|media|Scripts|system|public|upload|flash|css|js|pop-up|images|user_guide|scripts|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ /test/index.php/$1 [L]
有没有办法仅在任何特定页面中设置查询字符串格式?或者有什么办法可以克服这个问题吗?
In my project I need the query string feature and segment array feature. Because some return url is in the query string form.
I have made the following changes but it didn't work.
My config.php
looks like
$config['base_url'] = '';
$config['uri_protocol'] = 'PATH_INFO';
$config['enable_query_strings'] = TRUE;
And my .htaccess
file is
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^$ /test/index.php [L]
RewriteCond $1 !^(index\.php|resource|smsprinter|media|Scripts|system|public|upload|flash|css|js|pop-up|images|user_guide|scripts|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ /test/index.php/$1 [L]
Is there any way to set the query string format in any particular page only ? Or is there any way to overcome this issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经找到解决办法了。
htaccess文件中没有变化
但配置文件有一些变化。
配置文件应该是
$config['base_url'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
$config['enable_query_strings'] = FALSE;
I have find out the solution.
There is no chage in the htaccess file
But there is some change in the config file.
The config file should be
$config['base_url'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
$config['enable_query_strings'] = FALSE;