title: How to enable .htaccess in amazon ec2 running ubuntu
body: <p>I have an instance running ubuntu in ec2. I have this .htaccess file :-</p>
  
  <pre><code>Options +FollowSymlinks
  RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME}\.php -f
  RewriteRule ^(.*)$ $1.php
  </code></pre>
  
  <p>This file is located inside the <code>var/www/html</code> folder. I am aiming to achieve loading of <code>amazon-public-dns.com/index.php</code> as <code>amazon-public-dns.com/index</code>. <br><br>Now, I have tried these steps :-
  <br>1)
   Creating the <code>rewrite.conf</code> in <code>/etc/apache2/mods-enabled</code> and in the file putting the line <code>LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so</code>. (<a href="https://stackoverflow.com/a/19568145/3247497">Refer this answer</a>)
  <br>
  2)
   Running the command <code>apache2 enable module rewrite</code>. Also, in the file <code>/etc/apache2/sites-available/000-default.conf</code> and writing this in the end :-</p>
  
  <pre><code> &lt;Directory /var/www/html&gt;
          Options Indexes FollowSymLinks MultiViews
          # changed from None to FileInfo
          AllowOverride All
          Order allow,deny
          allow from all
   &lt;/Directory&gt;
  </code></pre>
  
  <p>Note that <a href="https://askubuntu.com/a/48363">this answer</a> told to edit the <code>default</code>. But, since that file was not there in my case, I edited the <code>000-default.conf</code> file.
  <br>
  I restarted apache as told. But the link <code>amazon-public-dns.com/index</code> gives me a 404 :( Please help me.<BR><BR>
  <B>EDIT</B> : I put some random junk in the htaccess file. But the index.php is not giving any 500 internal server error which means that the htaccess file is being ignored. Now in </p>
  
  <blockquote>
    <p><a href="https://help.ubuntu.com/community/EnablingUseOfApacheHtaccessFiles" rel="nofollow noreferrer">https://help.ubuntu.com/community/EnablingUseOfApacheHtaccessFiles</a></p>
  </blockquote>
  
  <p>, they say to enable htaccess edit this file - <code>/etc/apache2/sites-available/default</code>. <B>BUT THERE IS NO SUCH FILE</b></p>