我正在尝试访问此网站中的子域名网址
http://medica.mastertools.net/
但我总是得到:
The requested URL /logincheck was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.4.29 (Win32) OpenSSL/1.0.2l PHP/7.1.11 Server at medica.mastertools.net Port 80
我发现不是服务器配置,因为指向另一个文件夹,子域工作,所以Codeigniter中的某些内容可能是错误的。
在route.php中我有:
$route['default_controller'] = "home";
$route['logincheck'] = "home/logincheck";
和我的控制员:
class Home extends CI_Controller {
public function __construct()
{
parent::__construct();
}
function logincheck()
{
if(isset($_POST['strUsername']))
{
$blogin_ok = $this->logmodel->check_login($_POST['strUsername'], $_POST['strPassword']);
if( $blogin_ok == 1)
{
$this->index();
}
else if ( $blogin_ok == 2 )
{
$this->makeFinalLayout('loginchose');
}
else
{
$_SESSION['loggin_msg'] = LOGINERRORMSG;
$this->login();
}
}
else
{
$this->login();
}
}
答案 0 :(得分:1)
对于处理URL路径的框架,必须要做两件事:
如何启用mod_rewrite: How to enable mod_rewrite for Apache 2.2
重写规则: Apache rewrite rule
有关更多信息,请阅读Apache HTTP文档