title: .htaccess Redirect 404 Error
body: <p>I've been trying to get this right for 1 or 2 hours now, searching for similar problems and trying the solutions. This is probably is one of those thing again where the answer is really obvious.</p>
  
  <p>I am trying to redirect everyone who is accessing <em>domain.com/title/<strong>whatever</em></strong> and <em>domain.com/title/<strong>anotherpage</em></strong> to a PHP script, but it is giving me a 404 error when I try to access the page.</p>
  
  <p>I am using this code in my htaccess file:</p>
  
  <pre><code>RewriteEngine on
  RewriteRule ^/plugins/(.*)$ /yourscript.php?plugin=$1 [L]
  </code></pre>
  
  <p>Here is a full copy of my .htaccess file.</p>
  
  <pre><code>ErrorDocument 404 /error/404.php
  
  #Prevent full listing of files
  Options -Indexes 
  
  #Redirect plugins
  &lt;IfModule mod_rewrite.c&gt;
  RewriteEngine on
  RewriteRule ^/plugins/(.*)$ /foobar.php?plugin=$1 [NC,L]
  &lt;/IfModule&gt;
  
  #Hide .php extension
  &lt;IfModule mod_rewrite.c&gt;
  RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME}\.php -f
  RewriteRule ^(.*)$ $1.php [NC,L]
  &lt;/IfModule&gt;
  
  #compress
  AddOutputFilterByType DEFLATE text/plain
  AddOutputFilterByType DEFLATE text/html
  AddOutputFilterByType DEFLATE text/xml
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE application/xhtml+xml
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE application/x-javascript 
  </code></pre>
  
  <p>I've tried placing the foobar.php script in both the root folder and in a folder name plugins.</p>
  
  <p>Thank you in advance for any help.</p>