There are two ways to change magento admin path:

First Way:

By Using local.xml

Open the file located in app/etc/local.xml and find the following chunk of code: 

<admin>
    <routers>
        <adminhtml>
            <args>
                <frontname>< !&#91;CDATA&#91;admin&#93;&#93;></frontname>
            </args>
        </adminhtml>
    </routers>
</admin>

Change it to:

<admin>
    <routers>
        <adminhtml>
            <args>
                <frontname>< !&#91;CDATA&#91;your_path&#93;&#93;></frontname>
            </args>
        </adminhtml>
    </routers>
</admin>

Note:

  • Only letters or numbers are allowed no special characters is allowed then save that file.
  • After doing all these go to var/ and delete cache and session folder.

Now you can access your admin panel by using this path:

http://yoursite.com/index.php/your_path/

Second Way:

Change from admin Panel:

  • System => Configuration => ADVANCED => Admin => Admin Base URL
  • Set “Use Custom Admin Path” to Yes
  • Enter ‘yourpath‘ in “Custom Admin Path” field
  • Click  Save Config button to save the setting.
  • You will be logged out and login page will come with the following url:

http://yoursite.com/index.php/yourpath/

Note: if you will change the option “Use Custom Admin URL” to yes and set “Custom Admin URL” value and save your changes. you won’t able to login admin after your changes Generally user makes this mistake.

adminpath

Solution if you have done this mistake:

  • Go to phpmyadmin.
  • Open your database
  • open table core_config_data.
  • Search in path column admin/url/custom and set its ‘value’ field to empty
  • Search in path column admin/url/use_custom and set its ‘value’ field to 0

Or By using mysql query:


UPDATE `core_config_data` SET `value` = '' WHERE `path` = 'admin/url/custom';
UPDATE `core_config_data` SET `value` = '0' WHERE `path` = 'admin/url/use_custom';

  • Search for path column web/secure/base_url
  • You will find two result by one with scope default and on-other with scope stores.
  • Take the content of field ‘value’ with scope = ‘default’ to content of field ‘value’ with scope = ‘stores’

Or By using mysql query:


UPDATE `core_config_data` as ccd1 inner join ( SELECT `value` FROM `core_config_data` WHERE `scope` = 'default' AND `path` = 'web/secure/base_url' ) as ccd set ccd1.`value` = ccd.`value` WHERE ccd1.`path` = 'web/secure/base_url' AND ccd1.`scope` = 'stores';

Similarly repeat the process for “web/unsecure/base_url“.

  • Search for path field “web/unsecure/base_url
  • You will find two result by one with scope default and on-other with scope stores.
  • Take the content of field ‘value’ with scope = ‘default’ to content of field ‘value’ with scope = ‘stores’

Or By using mysql query:


UPDATE `core_config_data` as ccd1 inner join ( SELECT `value` FROM `core_config_data` WHERE `scope` = 'default' AND `path` = 'web/unsecure/base_url' ) as ccd set ccd1.`value` = ccd.`value` WHERE ccd1.`path` = 'web/unsecure/base_url' AND ccd1.`scope` = 'stores';


0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *