Magento 2 404 error admin panel

五迷三道 提交于 2019-12-10 14:58:17

问题


Recently I installed Magento ver 2.0

After successfull installation, I tried to login to admin panel but it say 404 not found.

I am really not getting what is causing such issue. Moreover from the URL it can seen that I am logged into admin oanel but the dashboards is not visible.

URL:

Can anyone shed some light on this ?


回答1:


I had the same issue. I had to enable the mod_rewrite module and set the AllowOverride to all for /var/www/html directory in the apache configuration file.




回答2:


Maybe a known issue? Some info regarding a work around currently as well.

https://github.com/magento/magento2/issues/254

According to that, this may fix it:

Quick fix: in app/code/Mage/Install/Model/Installer/Db.php:64 paste following

if($extName == 0) {
  continue;
}

after

foreach ($extensions as $extName) {



回答3:


As I remember magento2 admin panel placed at /backend path by default




回答4:


The problem is in getting of REQUEST_URI environment variable value and checking it withSCRIPT_FILENAME and SCRIPT_NAME environment variables values.

So a cause of the problem is in adding of /index.php/ prefix to the request path and the Magento url generation has this value hardcoded for admin.

Override method called _updatePathUseRewrites in /app/code/core/Mage/Core/Mode/store.php file : Replace this Function:

protected function _updatePathUseRewrites($url)
{
if ($this->isAdmin()    || !$this->getConfig(self::XML_PATH_USE_REWRITES) || !Mage::isInstalled()) {
$url .= basename($_SERVER['SCRIPT_FILENAME']).'/';        }
return $url;
}

with

    protected function _updatePathUseRewrites($url)
{
if ($this->isAdmin()    || !$this->getConfig(self::XML_PATH_USE_REWRITES) || !Mage::isInstalled()) {
$url .= '/';        }
return $url;
}

This will definitely solve your Problem



来源:https://stackoverflow.com/questions/15409710/magento-2-404-error-admin-panel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!