title: How to get correct product url for multistore magento?
body: <p>I am running following code in Magento root to get the product urls</p>
  
  <pre><code>&lt;?php
  require_once('app/Mage.php'); 
  umask(0);
  Mage::app(1);   
  
  
  $collection = Mage::getModel('catalog/product')
              -&gt;setStoreId(1)
              -&gt;getCollection();
  foreach( $collection as $product )
  {
      echo $product-&gt;getProductUrl(); 
      echo "&lt;br&gt;";
  }   
  
  
  ?&gt;
  </code></pre>
  
  <p>I am getting product urls like <strong><a href="http://example.com/catalog/product/view/id/5/" rel="nofollow">http://example.com/catalog/product/view/id/5/</a></strong> , But these urls are invalid.</p>
  
  <p>The product urls are as following in front end <a href="http://example.com/product.html" rel="nofollow">http://example.com/product.html</a></p>
  
  <p>How do I get the correct product urls? I have multi store Magento set-up.</p>