title: 2 codeigniter applications & htaccess
body: <p>I had a codeigniter proyect working in windows with XAMPP and now I was moving it to my RaspberryPi:</p>
  
  <ol>
  <li>Apache/2.2.22 (Debian) </li>
  <li>PHP 5.4.4-14+deb7u5 </li>
  <li>mysql  Ver 14.14 Distrib 5.5.31</li>
  </ol>
  
  <p>I have two codeignitir aplications (principal and panel) with this estructure</p>
  
  <pre><code>/ -&gt; (apache root folder)
  /appname/admin 
          /admin/application/ -&gt; (codeigniter application to panel)
  /appname/application/ -&gt; (codeigniter application to public)
  </code></pre>
  
  <p>Now I can't access to admin controllers and I think is because .htaccess. I get this in some url:
  my.domain/appname -> codeigniter welcome for public (this part is empty so I think is OK)
  my.domain/appname/admin/login.html -> Not Found. The requested URL /mydomain/admin/login was not found on this server.
  my.domain/appname/admin/index.php?controller=admin -> 404 Page Not Found (codeigniter style)
  my.domain/appname/admin/hello.html -> hello (a dummy file I put to try, works ok)</p>
  
  <p>In my codeigniter panel proyect I have</p>
  
  <pre><code>$config['base_url'] = 'http://my.domain/myapp/admin/';
  $config['index_page'] = '';
  $config['uri_protocol'] = 'AUTO';
  $config['url_suffix'] = '.html';
  </code></pre>
  
  <p>I think it's all about .htaccess but I don't understand them. How many files I need? What folders?</p>
  
  <p>I had this .htaccess in my /appname &amp; /appname/panel before </p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  RewriteEngine on
  RewriteBase /appname #to panel /appname/panel
  
  #Removes access to the system folder by users.
  #Additionally this will allow you to create a System.php controller,
  #previously this would not have been possible.
  #‘system’ can be replaced if you have renamed your system folder.
  RewriteCond %{REQUEST_URI} ^system.*
  RewriteRule ^(.*)$ /index.php/$1 [L]
  
  #Checks to see if the user is attempting to access a valid file,
  #such as an image or css document, if this isn’t true it sends the
  #request to index.php
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  #This last condition enables access to the images and css folders, and the robots.txt file
  RewriteCond $1 !^(index\.php|images|robots\.txt|css)
  RewriteRule .* index.php/$0 [PT,L] 
  &lt;/IfModule&gt;
  
  &lt;IfModule !mod_rewrite.c&gt;
  # If we don’t have mod_rewrite installed, all 404’s
  # can be sent to index.php, and everything works as normal.
  
  ErrorDocument 404 /index.php
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>I think RewriteEngine on is activated in my apache2.</p>