Forum Moderators: phranque
Options +FollowSymLinks -MultiViews
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule ^(.*)$ http://www.example.com/$1 [R=permanent,L]
In your Rule you are specifying a query string ($) that is not mentioned in the Cond.
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$