All about Magento E-commerce Store.......MagentoForum: Magento:How to change admin url path

Monday, June 27, 2011

Magento:How to change admin url path

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/


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.
I tried to change the Admin Base URL from Magento admin panel. But, I ran into problem and could not access the admin after that. Here is what I did:-
- 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.

3 comments:

  1. Hi this is kinda of off topic but I was wanting
    to know if blogs use WYSIWYG editors or if you have to manually code with HTML.
    I'm starting a blog soon but have no coding experience so I wanted to get advice from someone with experience. Any help would be greatly appreciated!
    Feel free to surf my homepage forja

    ReplyDelete
  2. Keep this going please, great job!
    My weblog - Instalación geotermia en Toledo

    ReplyDelete
  3. Do you mind if I quote a few of your articles
    as long as I provide credit and sources back to your website?
    My blog site is in the exact same niche as yours and my visitors would genuinely benefit from a
    lot of the information you provide here. Please let me
    know if this ok with you. Appreciate it!
    Feel free to visit my website :: topografía

    ReplyDelete