title: .htaccess redirect to a directory
body: <p>This is a very silly question but I am pretty weak in htaccess.</p>
  
  <p>I want all files (php, css, javascripts and images) located at <a href="http://localhost/template/" rel="nofollow noreferrer">http://localhost/template/</a>* to point to <a href="http://localhost/" rel="nofollow noreferrer">http://localhost/</a>* along with a 404 Error Handler that is located at <a href="http://localhost/tempalte/404.php" rel="nofollow noreferrer">http://localhost/tempalte/404.php</a></p>
  
  <p>I almost got it here but when I change</p>
  
  <pre><code>RewriteRule ^(.*)\.(css|php|js|png|gif) template/$1 [NC,L] to
  RewriteRule ^(.*)\.(css|php|js|png|gif) template/$1.$2 [NC,L] 
  </code></pre>
  
  <p>I get an internal server error.</p>
  
  <pre><code># BEGIN website
  &lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteBase /
  RewriteRule ^(.*)\.(css|php|js|png|gif) template/$1 [NC,L] 
  &lt;/IfModule&gt;
  
  Options -Indexes
  # END website
  </code></pre>