I have Mage 1.9 with my custom module installed. I have checked that the function
Mage::getUrl('mymodule/api/users/1');
return wrong url with admin path. We also use a custom path for the admin area. This is my config.xml
<admin>
<routers>
<adminhtml>
<args>
<modules>
<Mymodule_Mymodule before="Mage_Adminhtml">Mymodule_Mymodule_Adminhtml</Mymodule_Mymodule>
</modules>
</args>
</adminhtml>
</routers>
</admin>
<frontend>
<routers>
<mymodule>
<use>standard</use>
<args>
<module>Mymodule_Mymodule</module>
<frontName>mymodule</frontName>
</args>
</mymodule>
</routers>
Now, calling Mage::getUrl('mymodule/api/users/1')
from admin area return this url:
https://website.com/index.php/admin/mymodule/api/users/
Can anyone help?