【发布时间】:2019-02-05 06:31:46
【问题描述】:
我的本地 xampp codeigniter 项目的 url 是 http://localhost/ci_yudeesh/index.php 但后来想从 url 中删除 index.php 部分,所以我按照用户指南中给出的步骤操作。
之后我可以在没有 index.php 的情况下使用 url 访问项目 http://localhost/ci_yudeesh/
我有一个名为 Home 的控制器,我可以使用 http://localhost/ci_yudeesh/index.php/home 访问它 ,但是当尝试使用http://localhost/ci_yudeesh/home 访问它时会出现此错误:
这是我的配置:
$config['base_url'] = 'http://localhost/ci_yudeesh/';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
这是我的 .htaccess:
<IfModule authz_core_module>
Require all denied
</IfModule>
<IfModule !authz_core_module>
Deny from all
</IfModule>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
这是我的路线:
$route['default_controller'] = 'Home';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
有人可以帮我解决这个问题吗?我尝试了类似类型问题的所有其他答案,但都没有奏效。
【问题讨论】:
标签: php .htaccess codeigniter codeigniter-3