[英]codeigniter query string and segment together
In my project I need the query string feature and segment array feature. 在我的项目中,我需要查询字符串功能和段数组功能。 Because some return url is in the query string form.
因为一些返回URL是查询字符串形式的。 I have made the following changes but it didn't work.
我做了以下更改,但是没有用。
My config.php
looks like 我的
config.php
看起来像
$config['base_url'] = '';
$config['uri_protocol'] = 'PATH_INFO';
$config['enable_query_strings'] = TRUE;
And my .htaccess
file is 我的
.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]
Is there any way to set the query string format in any particular page only ? 有什么方法可以只在任何特定页面中设置查询字符串格式吗? Or is there any way to overcome this issue?
还是有什么办法可以克服这个问题?
I have find out the solution. 我已经找到了解决方案。 There is no chage in the htaccess file But there is some change in the config file.
htaccess文件中没有更改,但配置文件中有一些更改。 The config file should be $config['base_url'] = '';
配置文件应为$ config ['base_url'] =''; $config['uri_protocol'] = 'REQUEST_URI';
$ config ['uri_protocol'] ='REQUEST_URI'; $config['enable_query_strings'] = FALSE;
$ config ['enable_query_strings'] =否;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.