在codeigniter中启用查询字符串问题

时间:2017-02-06 20:25:45

标签: php codeigniter

我正在尝试在codeigniter 3.1.2中启用查询字符串但是在更改了所有设置后我无法启用它请帮助我

我的config.php设置

$config['uri_protocol'] = 'PATH_INFO';
$config['enable_query_strings'] =TRUE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd';

在此之后我得到了我的网址

http://127.0.0.1/new/?computer

我不知道我错在哪里请帮助我们 还有我的.htaccess文件

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

1 个答案:

答案 0 :(得分:0)

您还需要检查Apache和PHP之间的配置。你可能需要修补php.ini和apache2.conf / httpd.conf(取决于你是哪个发行版)。但作为快速测试,您应该能够看到 mod_rewrite 被加载。

<?php
print_r(apache_get_modules());
?>

http://php.net/manual/en/function.apache-get-modules.php