Anton Kolenkov
Anton Kolenkov

Reputation: 340

How to get base admin Magento url?

It should be trivial, but cannot find a correct way. Even if default is "/admin" I would like not to hardcode as it might change in future.

Obviously, these variants are incorrect:

Mage::getUrl('admin');
Mage::helper('adminhtml')->getUrl('admin');

UPD: It seems some clarification is needed. Right now I have this url to my admin panel:
http://sample.com/admin
but later I might have to change it to
http://sample.com/backend
and would like to keep my link generating code untouched.

Upvotes: 1

Views: 3468

Answers (3)

Sheshgiri Anvekar
Sheshgiri Anvekar

Reputation: 145

echo Mage::helper('adminhtml');

Upvotes: 0

samumaretiya
samumaretiya

Reputation: 1175

From the following url you will find different way to get Admin specific url http://www.codexpedia.com/magento/magento-getting-the-admin-panel-urls/

Upvotes: 0

Denis
Denis

Reputation: 331

try this

Mage::getUrl('adminhtml');

Upvotes: 7

Related Questions