【发布时间】:2021-02-03 23:41:29
【问题描述】:
从 URL 中删除 index.php 时,我收到一个错误 Not found
来自:- http://localhost/Inspire/index.php/welcome/dashboard
到这里
http://localhost/Inspire/welcome/dashboard
.htaccess
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
config.php
$config['index_page'] = '';
【问题讨论】:
-
能否请您告诉我们您尝试从哪个 URL 重定向到哪个 URL,以便更清楚地了解
-
请马上回答问题。
-
$config['uri_protocol'] = "REQUEST_URI" 用这个改变 AUTO
-
仍然出现同样的错误
-
你在哪里创建 .htaccess 文件??
标签: php .htaccess codeigniter codeigniter-4