I would like to redirect example.com/test
to www.example.com/test
and example.com/contact
to www.example.com/contact
.
So with all the routes of the web.
Everything I find, what it does is redirect example.com/test
to www.example.com
Below is my code, and with all that I have tried it happens to me the same. They work fine, but they don't do what I want.
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
Please, any suggestions. Thanks!