【发布时间】:2016-03-12 07:04:45
【问题描述】:
我正在使用 codeigniter 3。
我创建了类似的登录控制器
<?php
class Login extends CI_Controller
{
public function index()
{
echo "It's working";
}
}
?>
我的 .htaccess 文件
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
我还启用了重写模块。
正在处理中
http://localhost/codeigniter/index.php/login
但不上
http://localhost/codeigniter/login
我该如何解决这个问题。或其在 codeigniter 3.0.4 中的错误 请帮忙。
【问题讨论】:
-
你使用什么 localhost,xampp,wamp?
-
在你的 config.php 上你有没有像这样
$config['index_page'] = ''; -
@wolfgang1983 xampp ,在 config.php 我有
$config['index_page'] = 'index.php'; -
试试这个配置!!! stackoverflow.com/questions/2171185/…
-
@AldoZumaran 收到此错误找不到对象!在此服务器上找不到请求的 URL。如果您手动输入了 URL,请检查您的拼写并重试。如果您认为这是服务器错误,请联系网站管理员。错误 404 本地主机
标签: php .htaccess codeigniter mod-rewrite codeigniter-3