There are a couple of things wrong with the above rules, but the one that is really causing you a problem is that you forgot a ! in front of the right operand of the first RewriteCond.
Other things that are wrong include:
- dots
. must be escaped to have their literal meaning in a regular expression, which is what the second argument to RewriteCond is.
- the
(.*) would be much safer if you included ^$
request_filename should be capitalised
- Rewriting a URL to itself is confusing and unnecessary, simply pass
- as the second argument to the RewriteRule instead. But there is no need for that rule, simply negate the RewriteCond and apply it to the next rule.
Try this file instead:
<ifmodule mod_rewrite.c>
# Turn mod_rewrite on
RewriteEngine on
# Force a www on the beginning of the URL
RewriteCond %{HTTP_HOST} !^www\.online4movies\.com
RewriteRule ^(.*)$ http://www.online4movies.com/$1 [R=301,L]
# Parse URLs for files that don't exist and send them through index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([a-z]+)(/([^/]{0,32})(/.+)?)?$ index.php?a=$1&q=$3 [L]
</ifmodule>