title: PHP Codeigniter - Apache virtual host setup trouble
body: <p>This has been doing my head in. Hope you guys can help. I can't find out where the error lies.</p>
  
  <p><em>httpd-vhosts.conf</em></p>
  
  <pre><code>NameVirtualHost 127.0.0.1
  
  &lt;VirtualHost 127.0.0.1&gt;
      DocumentRoot /opt/lampp/htdocs
      ServerName localhost
  &lt;/VirtualHost&gt;
  
  &lt;VirtualHost 127.0.0.1&gt;
      DocumentRoot /home/tilman/Sites/mysite/www
      ServerName mysite.lo
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p><em>/etc/hosts</em></p>
  
  <pre><code>127.0.0.1   localhost
  127.0.0.1   mysite.lo
  </code></pre>
  
  <p><em>config.php</em></p>
  
  <pre><code>$config['base_url'] = "http://mysite.lo";
  $config['index_page'] = "";
  </code></pre>
  
  <p><em>www/.htaccess</em></p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
      RewriteEngine On
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ index.php/$1 [L]
  &lt;/IfModule&gt;
  &lt;IfModule !mod_rewrite.c&gt;
      ErrorDocument 404 index.php
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>Now <code>http://mysite.lo</code> shows me the default controller. <code>http://mysite.lo/index.php</code> as well. So does <code>http://mysite.lo/index.php/welcome</code>.</p>
  
  <p>But <code>http://mysite.lo/welcome</code> doesn't.</p>
  
  <p><code>http://localhost/mysite/www/welcome</code> works as expected.</p>
  
  <hr>
  
  <p>edit:
  I want to move system and application out of the web root.
  So my file structure looks like this:</p>
  
  <pre><code>application/
  system/
  www/
   '- index.php
  </code></pre>
  
  <p>In index.php I changed the paths to system and application folder, of course.</p>