Magento 404管理员页面登录 [英] Magento 404 Admin Page Login
问题描述
今天早些时候尝试进入管理页面时,我收到404错误.自从我上次登录以来,没有做任何更改,我唯一要做的就是将产品分配给类别.
I am getting a 404 error when trying to go to my admin page was working fine earlier today. Haven't changed anything since I last logged in and the only thing I was doing was assigning products to categories.
http://mytempsite.net/gotie/admin
到底有什么失败
删除以下文件:-
WHAT IVE TRIED SO FAR
Delete the following file:-
app/etc/use_cache.ser<-我在ftp或ssh中找不到文件
app/etc/use_cache.ser <-- I could not find the file in ftp or ssh
然后尝试这样做
打开PhpMyAdmin
-进入我的数据库
-点击了SQL
-运行以下SQL查询:
then tried doing this
Opened PhpMyAdmin
- Went to my database
- Clicked SQL
- Ran the following SQL Query:
SET FOREIGN_KEY_CHECKS = 0;
UPDATE core_store
SET store_id = 0 WHERE code ='admin';
UPDATE core_store_group
SET group_id = 0 WHERE name ='Default';
UPDATE core_website
SET website_id = 0 WHERE code ='admin';
UPDATE customer_group
SET customer_group_id = 0 WHERE customer_group_code ='NOT LOGGED IN';
SET FOREIGN_KEY_CHECKS = 1;
SET FOREIGN_KEY_CHECKS=0;
UPDATE core_store
SET store_id = 0 WHERE code='admin';
UPDATE core_store_group
SET group_id = 0 WHERE name='Default';
UPDATE core_website
SET website_id = 0 WHERE code='admin';
UPDATE customer_group
SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGED IN';
SET FOREIGN_KEY_CHECKS=1;
推荐答案
问题在于获取REQUEST_URI环境变量值,并使用SCRIPT_FILENAME和SCRIPT_NAME环境变量值对其进行检查.
The problem is in getting of REQUEST_URI environment variable value and checking it withSCRIPT_FILENAME and SCRIPT_NAME environment variables values.
所以造成问题的原因是在请求路径中添加了/index.php/前缀,并且Magento url生成的值已硬编码为admin.
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.
在/app/code/core/Mage/Core/Mode/store.php文件中覆盖名为_updatePathUseRewrites的方法:替换此功能:
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;
}
使用
protected function _updatePathUseRewrites($url)
{
if ($this->isAdmin() || !$this->getConfig(self::XML_PATH_USE_REWRITES) || !Mage::isInstalled()) {
$url .= '/'; }
return $url;
}
这肯定会解决您的问题
这篇关于Magento 404管理员页面登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!