[英]codeigniter query string and segment together
在我的项目中,我需要查询字符串功能和段数组功能。 因为一些返回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]
有什么方法可以只在任何特定页面中设置查询字符串格式吗? 还是有什么办法可以克服这个问题?
我已经找到了解决方案。 htaccess文件中没有更改,但配置文件中有一些更改。 配置文件应为$ config ['base_url'] =''; $ config ['uri_protocol'] ='REQUEST_URI'; $ config ['enable_query_strings'] =否;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.