title: Error 404: The links on my website don't work, only index (using Codeigniter & .htaccess)
body: <p>I am hosting my website <a href="http://tstspanama.com/" rel="nofollow noreferrer">http://tstspanama.com/</a> on a Apache server. It was created with the PHP framework Codeigniter. I can only see the home page but nothing else, the links don't work.</p>
  <p>If I want to go to <code>http://tstspanama.com/servicios</code>, I get:</p>
  <blockquote>
  <p>Not Found</p>
  <p>The requested URL <code>/servicios</code> was not found on this server</p>
  </blockquote>
  <p>Does anyone have an idea of how ti fix this? I attach all important code.</p>
  <p><strong>On application config (/var/www/tsts/application/config/config.php)</strong></p>
  <pre><code>$config['base_url']     = isset($_SERVER['REQUEST_URI']) &amp;&amp; $_SERVER['HTTP_HOST'] != 'localhost' ? 'http://'.$_SERVER['HTTP_HOST'].'/' : 'http://www.tstspanama.com/';
  
  $config['index_page'] = '';
  
  $config['uri_protocol'] = 'AUTO';
  </code></pre>
  <p><strong>On my .htaccess</strong></p>
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
      RewriteEngine on
      RewriteBase /tsts/
      RewriteCond $1 !^(index\.php|assets|images|css|js|robots\.txt)
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^(.*)$ index.php/$1 [QSA,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;
  
  &lt;ifModule mod_php5.c&gt;
      php_value default_charset utf-8
  &lt;/ifModule&gt;
  
  php_flag display_startup_errors on
  php_flag display_errors on
  php_flag html_errors on
  </code></pre>
  <p><strong>On /etc/apache2/sites-available/www.tstspanama.com</strong></p>
  <pre><code>&lt;VirtualHost *:80&gt;
      ServerName www.tstspanama.com
      ServerAlias tstspanama.com
  
      DocumentRoot /var/www/tsts
      &lt;Directory /&gt;
              Options FollowSymLinks
              AllowOverride None
      &lt;/Directory&gt;
  
      &lt;Directory /var/www/tsts&gt;
              Options Indexes FollowSymLinks MultiViews
              AllowOverride None
              Order allow,deny
              allow from all
      &lt;/Directory&gt;
  
      ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
      &lt;Directory &quot;/usr/lib/cgi-bin&quot;&gt;
              AllowOverride None
              Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
              Order allow,deny
              Allow from all
      &lt;/Directory&gt;
  
      ErrorLog /var/log/apache2/error.log
      # Possible values include: debug, info, notice, warn, error,
      # crit, alert, emerg.
      LogLevel error
      CustomLog /var/log/apache2/access.log combined
      Alias /doc/ &quot;/usr/share/doc/&quot;
      &lt;Directory &quot;/usr/share/doc/&quot;&gt;
          Options Indexes MultiViews FollowSymLinks
          AllowOverride None
          Order deny,allow
          Deny from all
          Allow from 127.0.0.0/255.0.0.0 ::1/128
      &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  </code></pre>