modify my Apache .htaccess file

Job ID: 32509052

Budget: $10 – $30 USD

hi, i want to modify my .htaccess file to 301 my non-www traffic to my www. I have been using this code

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.example.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]

But when i do that, my wordpress site in a subdirectory redirects to the main page and does not allow my subscribers to log in.

The project is quick and simple, re-write my htaccess to allow for non-www to www redirect without messing with my other Wordpress on the same domain.
Related categories: PHP Linux Apache Nginx MySQL