title: Codeigniter base_url() not working properly
body: <p>i have set my <code>base_url()</code> like this </p>
  
  <pre><code>  $config['base_url'] = 'http://example.com/';
  </code></pre>
  
  <p>Now the problem is all links works fine if there is no <code>www</code> before the url. But if try to access website using <code>www</code> before the url like <code>http://www.example.com/</code> than the <code>base_url()</code> is not working. If i add <code>www</code> in the <code>base_url()</code> than the links without <code>www</code> does not work.</p>
  
  <p>My .htaccess is as follows,</p>
  
  <pre><code>RewriteEngine on
  RewriteCond $1 !^(index\.php|resources|robots\.txt)
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php/$1 [L,QSA]
  </code></pre>