title: Apache RewriteRule - Can't remove "index.php?q="
body: <p>I'm testing .htaccess file on the server. The goal is to convert <code>www.mysite.com/index.php?q=help</code> into <code>mysite.com/help</code>  </p>
  
  <p>1)to remove <code>www.</code> 
  2) to remove <code>index.php?q=</code></p>
  
  <p>My .htaccess in the root directory contains:</p>
  
  <pre><code>RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-d 
  RewriteRule ^(.*)$ /index.php?q=$1 [L] 
  </code></pre>
  
  <p>Nothing happens - index.php?q=help is still there...
  Does anybody know, why?</p>
  
  <p>Thank you.</p>
  
  <p>Matthew, thanks again. Here is another version, the problem solved for 50%.</p>
  
  <pre><code>RewriteEngine On 
  RewriteCond %{HTTP_HOST} ^www.mysite.com$ [NC] 
  RewriteRule ^(.*)$ http://mysite.com/$1 [L,R=301] #removes www., works fine 
  RewriteRule ^index\.php/?$ http://mysite.com/ [NC,R,L] #still doesn't work - it does not remove index.php as needed
  </code></pre>