将所有domain.co.il重定向到www.domain.co.il(包括子文件夹)

I know there is a lot of question regarding this though non of the answers is working for me .

My current .htaccess file ( which placed in the public_html folder ) is :

RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain\.co.il$ [NC]
RewriteRule ^(.*)$ http://www.domain.co.il/$1 [L,R=301]

Though this only redirects domain.co.il to www.domain.co.il .

If I try to enter a url like : domain.co.il/forums/forum.php it wont redirect to www.domain.co.il/forums/forum.php as i want it to do .

P.S of course the "domain" was replaced with my real domain name.

Try this one:

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