Magento: How to get admin URL programmatically

The backend (or admin) URL is configured in app/etc/local.xml. We need to parse that file. It is easier than I thought first.

$adminURL = (string)Mage::getConfig()->getNode(“admin/routers/adminhtml/args”)->frontName;

That’s all.

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload the CAPTCHA.