.htaccess redirect non-www to www

I’m using amfphp in a current project, which requires users to view “www.theDomain.co.uk” rather than simply “theDomain.co.uk”. To ensure all users get complete functionality, I am trying to reidrect all non-www pages to their www-prefixed counterpart.

This is how my .htaccess file currently looks:


###### Redirect / to www ######
RewriteCond %{HTTP_HOST} ^theDomain.co.uk
RewriteRule (.*) http://www.theDomain.co.uk/$1 [R=301,L]
RewriteRule ^$ index.php
#########################

If I type in “http://theDomain.co.uk/dev” to view the development site, the redirect works and I am taken to “http://www.theDomain.co.uk/dev”.

However, If I simply target "“http://theDomain.co.uk” the redirect appears to do nothing and the page remains at the non-www version.

Any ideas?