Skip to main content

How to fix Magento Admin – Error 404 page not found

how to fix the missing admin page of magento.
Fix for Magento Admin – Error 404 page not found



Sometimes, expecially when you migrate to another server, the admin page can be missing.

1 - Error 404 admin page /admin
Before anything check your configuragion file ( app/etc/local.xml) and make sure that you have "admin" as value for the "frontname" tag.
ex.:
            <adminhtml>
                <args>
                    <frontName><![CDATA[admin]]></frontName>
                </args>
            </adminhtml>


Usually when you try http://yoursite.com/admin it gives you the admin area
Try using an url like that http://yoursite.com/index.php/admin
and if it works probably you need to only modify the rewrite rules or follow the suggestions (see the link below)

edit the file "app/code/core/Mage/Core/Model/Session/Abstract/Varien.php"
in magento 1.3 replace:
session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath(),
$this->getCookie()->getDomain(),
$this->getCookie()->isSecure(),
$this->getCookie()->getHttponly()
);
with:
session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath()
);

 in magento 1.4 and above - comment out:
if (!$cookieParams[’httponly’]) {
    unset($cookieParams[’httponly’]);
    if (!$cookieParams[’secure’]) {
        unset($cookieParams[’secure’]);
        if (!$cookieParams[’domain’]) {
            unset($cookieParams[’domain’]);
        }
    }
}
if (isset($cookieParams[’domain’])) {
    $cookieParams[’domain’] = $cookie→getDomain();
}
example:

/*
if (!$cookieParams[’httponly’]) {
    unset($cookieParams[’httponly’]);
    if (!$cookieParams[’secure’]) {
        unset($cookieParams[’secure’]);
        if (!$cookieParams[’domain’]) {
            unset($cookieParams[’domain’]);
        }
    }
}
if (isset($cookieParams[’domain’])) {
    $cookieParams[’domain’] = $cookie→getDomain();
}
*/




source: http://www.magentocommerce.com/wiki/how_to_fix_login_for_admin_on_local_install

2 - Error 404 in the admin page due to the failed TLS/SSL
If you get a 404 error page due to the redirect to a secure ssl page
 Just run this sql (ex. with phpmyadmin):
UPDATE `core_config_data` SET `value` = '0' WHERE `path`='web/secure/use_in_frontend';

Source: http://www.magentocommerce.com/wiki/recover/ssl_access_with_phpmyadmin


3- Problem error 404 for the admin page due to the incorrect importation of the sql data

If the directive
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */
have been ignored during the import it should be better to re-import the whole backup otherwise several records can be wrong as those that are giving problems (see below)
Make sure that core_store, core_store_group, core_website, and customer_group table ids have the value of '0'.

Check that the values in the database are correct otherwise run this sql command if you don't have time to waste or you don't have the previous backup to reimport:
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;
  Source: http://stackoverflow.com/questions/5178066/error-404-not-found-in-magento-admin-login-page



NOTE: delete the cache files in var/cache. Remove the cache in your browser. Restart the browser if you are switching IP addresses via hosts file

Comments

  1. I am using wamp i am not able to find the location in the first step... help to resolve the problem and i have one more issue CSS is not loading in the website(localhost)

    ReplyDelete
  2. @Achyuta Surya Teja
    you need to write what is the magento version, what is the specific page/error that is leading to a 404 page, etc.

    If the css is not loading in frontend probably you need to check the your configuration or paths of the template.

    if you have an htaccess check if the rewritebase is correct.

    Before anything you need to solve the admin area problem.

    ReplyDelete

Post a Comment

Popular posts from this blog

Moodle 3.8.1+ - path leak via errors in several files

Moodle 3.8.1+ ----------------------------------------------- File: admin/mailout-debugger.php #!/usr/bin/php Notice : Disabled. in \admin\mailout-debugger.php on line 73 File: admin/settings/appearance.php Notice : Undefined variable: hassiteconfig in \admin\settings\appearance.php on line 10 Fatal error : Uncaught Error: Call to undefined function has_any_capability() in \admin\settings\appearance.php:10 Stack trace: #0 {main} thrown in \admin\settings\appearance.php on line 10 File: admin/settings/badges.php Notice : Undefined variable: hassiteconfig in \admin\settings\badges.php on line 30 Fatal error : Uncaught Error: Call to undefined function has_any_capability() in \admin\settings\badges.php:30 Stack trace: #0 {main} thrown in \admin\settings\badges.php on line 30 File: admin/settings/courses.php Notice : Undefined variable: hassiteconfig in \admin\settings\courses.php on line 32 Fatal error : Uncaught Error: Call to undefined function

2022 - Remove (the too many) Ads from Memu launcher

Simple method Download from pureapk "MEmu Launcher2" ex: MEmu Launcher2_v6.0.9_apkpure.com Install "System app remover" (root) remove from system apps the "memu launcher 2" import the "purified" MEmu Launcher2 apk with the Memu utility ("apk" on the right toolbar) Longer method Install "Export Apk" Export the memu launcher2  Install purify https://github.com/echo-devim/purify/raw/master/Purify.apk use purify with the exported memu launcher 2 Install "System app remover" (root) remove from system apps the "memu launcher 2" import the "purified" MEmu Launcher2 apk with the Memu utility ("apk" on the right toolbar)