title: Magento - Change store base url programatically
body: <p>I want to programmatically change the base URL (secure and unsecure) for a magento store.</p>
  
  <p>The settings can be changed manually in the backend, seen in the following picture:</p>
  
  <p><a href="http://geo.magenting.com/m/kb/images/attachments/change-magento-base-url_1.jpg" rel="nofollow">http://geo.magenting.com/m/kb/images/attachments/change-magento-base-url_1.jpg</a></p>
  
  <p>I want to change the values at 4 &amp; 5 for each of my stores.</p>
  
  <p>Something like this:</p>
  
  <pre><code>$store = Mage::getModel('core/store')-&gt;load($storeId);
  $store -&gt; setBaseUrlSecure("xyz.com");
  $store -&gt; save();
  </code></pre>
  
  <p>Any help on how I can do that?</p>