title: Apache2, PHP 7.1, mod_rewrite, .htaccess 404
body: <p>Hi I seem to be having some issues with mod_rewrite. </p>
  
  <p>.htaccess is rewriting urls from /welcome to /welcome.php ;</p>
  
  <p>but they are returning 404 errors.</p>
  
  <p>Apache2 
  PHP 7.1
  MySQL 5.8
  mod_rewrite is enabled and loaded</p>
  
  <p>Can someone please help I'm totally lost?</p>
  
  <pre><code>    &lt;IfModule mod_rewrite.c&gt;
  RewriteEngine on
  RewriteBase /
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  
  #For removing extension as Options +MultiViews not working with RewriteRule
  RewriteRule ^([a-zA-Z0-9_]+)$ $1.php [QSA,NC,L]
  
  RewriteRule ^profile/([a-zA-Z0-9._@\-]+)$ profile.php?u=$1 [QSA,NC,L]
  RewriteRule ^profile/ profile.php [QSA,NC,L]
  
  RewriteRule ^groups/([0-9]+)$ groups.php?grp=$1 [QSA,NC,L]
  RewriteRule ^groups/ groups.php [QSA,NC,L]
  
  RewriteRule ^view_post/([a-zA-Z0-9]+)$ view_post.php?post=$1 [QSA,NC,L]
  
  ErrorDocument 404 /404.php
  
  #DirectoryIndex Options +Indexes
  
  &lt;FilesMatch ".(htaccess)"&gt;
    order allow,deny
    deny from all
  &lt;/FilesMatch&gt;
  
  #Options +MultiViews
  
  IndexIgnore *
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>Thats my .htaccess file.</p>