【发布时间】:2020-06-18 22:21:23
【问题描述】:
我在这个网站和其他网站上查看了很多提供的解决方案,但似乎找不到有效的解决方案。
我刚刚从 Xamp 下载了 Codeigniter 并将其放在 htdocs 文件夹中。将其名称更改为“notas”。更改notas/config/config.php这样的属性
$config['base_url'] = 'http://localhost/notas/';
$config['index_page'] = '';
使用多种方法在'notas' 中创建了一个 .htaccess 文件。目前,我是这样的
RewriteEngine On
RewriteBase /notas/
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*?)/?$ $1.php [NC,L]
URL http://localhost/notas/welcome 返回 Object not found - 404,welcome 是文件夹中的默认控制器
如果我这样写,我会收到 500 错误
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1
如果我可以提供任何其他数据来帮助解决它,请索取
谢谢
编辑
如果我把 .htaccess 文件像
Satisfy all
或
Satisfy any
仍然得到 404。我已经重新检查了控制器文件夹内是否存在 Welcome.php 文件
【问题讨论】:
-
尝试其他htaccess数据stackoverflow.com/questions/10209010/…
-
尝试了帖子中的所有 htaccess。唯一从 404 变为 500 的是 Ak memon
-
尝试配置你的 index_page
$config['index_page'] = ''指向你的索引文件
标签: php .htaccess codeigniter xampp