I need to get the exact URL when customer visit my site on first time,
It is based on following options
- base url that depends on default website,store and store view,
- store code to urls enabled or not.
I got the base URL by
$websites = Mage::getModel('core/website')->getCollection()->addFieldToFilter('is_default', 1); $website = $websites->getFirstItem(); $websiteId = $website->getId(); $websiteCode = $website->getCode(); $baseUrl = Mage::getConfig()->getNode('web/unsecure/base_url', 'website', $websiteCode);
The URL will be appended with store code if store code to urls is enabled in admin.
how to check store code to urls enabled programmatically in magento?