Magento – Change default Admin URL Path / Router

  • magento default admin url

Here is a quick guide on how to change admin url path in Magento. This need to be done for security reason to be safe from hacking/cracking issue. Basically, this is done not to let any general user to access the admin page.

Generally, we do have ‘admin‘ as the administrator path for Magento. So, the admin URL will be http://www.example.com/admin/

 

This article will show you, how you can change the admin url. Let’s say from ‘admin‘ to ‘backend‘. So, the new admin URL will be http://www.example.com/backend/

Here is how we do it:-

– Open app/etc/local.xml

– Find the following:-

<admin>
	<routers>
            <adminhtml>
                <args>
                    <frontName><![CDATA[admin]]></frontName>
                </args>
            </adminhtml>
        </routers>
</admin>

– Change

<frontName><![CDATA[admin]]></frontName>

to your desired name. Like below:-

<frontName><![CDATA[backend]]></frontName>

– Save the file

– Refresh the Cache from Magento Admin (System -> Cache Management)

Now, you should be able to access admin panel from http://www.example.com/backend/ instead of http://www.example.com/admin/

Looking for improvement for your Magento Store?
Facebook Connector Extension
Product related article extension
Magento Offer popup on exit extension
Unlimited Slideshow Magento Extension
Light Checkout in One Step Magento Extension

Important Note

If you just need to change the admin base URL then the proper way I find is by doing the change in local.xml like explained above, instead of editing configuration setting from admin like said below.

For someone who tried to change the Admin Base URL from Magento admin panel but ran into problem and could not access the admin after that. Here is what to fix this problem

System -> Configuration -> ADVANCED -> Admin -> Admin Base URL

– Changed Use Custom Admin URL = Yes

– Changed Custom Admin URL (Once I tried with ‘backend/’ and then with ‘http://www.example.com/backend/’)

To solve the problem, I had to make some change in database. If you had similar problem then here is a workaround:-

– Open your database

– Browse table ‘core_config_data

– Search in path field for ‘admin/url/use_custom‘ and set its value to ’0′

– Search in path field for ‘admin/url/custom‘ and set its value to empty

– Search in path field for ‘web/secure/base_url

– You will find two row result. One with scope = default and another with scope = stores.

– Edit the value of row with scope = stores with the value of the row with scope = default

– Similarly, repeating the process for ‘web/unsecure/base_url‘:-

– Search in path field for ‘web/unsecure/base_url

– You will find two row result. One with scope = default and another with scope = stores.

– Edit the value of row with scope = stores with the value of the row with scope = default

– Now, you will be able to login to Magento admin with your old admin base URL.

Hope this helps. Thanks.


Comments Closed