title: Yii2 remove index.php from url
body: <p>When I set the option in Yii to remove index.php from the URL I get a 404 error and this error in the error logs <code>File does not exist: /var/live/var</code>. In my browser I get this error <code>The requested URL /var/decat/frontend/web/index.php was not found on this server.</code> but the file is exactly in that location. What might explain that is that my document root is <code>/var/live</code> and decat is an alias as shown in the conf file.</p>
  
  <p>This url works fine <a href="http://13.21.16.180/decat/index.php/site/login" rel="nofollow noreferrer">http://13.21.16.180/decat/index.php/site/login</a> but when I remove index.php is when I get the error. I followed all the instructions to set it up in the conf file. I even tried through an .htaccess file. Here is the info from my conf file. </p>
  
  <pre><code>Alias /decat /var/decat/frontend/web
  
  &lt;Directory "/var/decat/frontend/web"&gt;
          # use mod_rewrite for pretty URL support
          RewriteEngine on
          # If a directory or a file exists, use the request directly
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          # Otherwise forward the request to index.php
          RewriteRule . index.php 
          Options -Indexes FollowSymLinks 
          AllowOverride All
          Order allow,deny 
          Allow from all 
  &lt;/Directory&gt;
  </code></pre>