How to find the current URL in Magento?

You must be wondering we can simply use: $currentUrl = Mage::helper(‘core/url’)->getCurrentUrl() or $currentUrl = Mage::getUrl(‘*/*/*’, array(‘_current’ => true)); in order to find the current URL. But it doesn’t always work as expected. Try to use the above code in a page which has some missing CSS, js, images, etc.(You can use Firebug in order to …

Read more