【发布时间】:2021-04-11 21:21:15
【问题描述】:
没有 index.php,我无法访问 base_url/controller/method,我尝试使用 .htaccess 删除 index.php,但仍然无法正常工作。 404 Page Not Found 但我的另一个项目在同一个 xampp 中使用相同的设置
这是我的 config.php
$config['base_url'] = 'http://localhost/sistem-informasi-bimbel/';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
这是我的 routes.php
$route['default_controller'] = 'main/home';
$route['404_override'] = '';
$route['translate_uri_dashes'] = TRUE;
这是我的 .htaccess 文件,我把它放在应用程序文件夹之外
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
在 httpd.conf 上启用了 mod 重写
LoadModule rewrite_module modules/mod_rewrite.so
【问题讨论】:
-
设置好后重启xampp?
-
是的,我在启用 mod_rewrite 后重新启动 xampp
标签: php .htaccess codeigniter