我的.htaccess文件包含以下行:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>**
我的config.php有以下几行:
$config['base_url'] = 'http://localhost/Shifas/Codeigniter/CodeIgniter-2.2.6';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
默认控制器是Stud_controller
答案 0 :(得分:1)
您提供给$config['base_url']
的值必须有一个尾部斜杠。
尝试
$config['base_url'] = 'http://localhost/Shifas/Codeigniter/CodeIgniter-2.2.6/';
答案 1 :(得分:0)
您可能必须在apache https://www.digitalocean.com/community/tutorials/how-to-rewrite-urls-with-mod_rewrite-for-apache-on-ubuntu-16-04
上允许mod_rewrite您还需要一个尾部斜杠:
$config['base_url'] = 'http://localhost/Shifas/Codeigniter/CodeIgniter-2.2.6/';
$config['uri_protocol'] = 'AUTO';