In a word, don't!

I just saw an insane suggestion on a Magento forum, advising users to change their admin url by hacking app/code/core/Mage/Adminhtml/etc/config.xml.

This is dangerous and pointless. Dangerous, because when you attempt to upgrade magento, you will at best lose your custom configuration, and at worst, cause an upgrade to fail. Pointless, because you can achieve the same effect by making changes to app/etc/local.xml.


This file overrides any configuration set elsewhere and by default, actually already has a definition for a custom admin url. When you install Magento, the installer sets up this file up by subbing in the details you provide the installer into local.xml.template.

So to change your admin url, after running the installer, simply fire up an editor and open app/etc/local.xml and look for this:

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

Change the admin (inside the CDATA declaration) to foobar, or gobbles, or topsecret, whatever. Much easier, much safer than hacking away at core magento configuration files.