Forum Moderators: phranque
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTP_HOST} ^([^.]+\.)+([^\.]+\.(com|co\.uk|info|at))\.?(:[0-9]+)?$
RewriteRule ^ http://www.%2%{REQUEST_URI} [R=301,L] [edited by: jdMorgan at 1:54 am (utc) on Feb 11, 2010]
[edit reason] Delinked [/edit]
RewriteCond %{HTTP_HOST} ^([^\.]+\.(com|co\.uk|info|at))\.?(:[0-9]+)?$
RewriteRule ^ http://www.%1%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} ^([^\.]+\.(com|co\.uk|info|at))\.?(:[0-9]+)?$ [OR]
RewriteCond %{HTTP_HOST} ^www\.([^\.]+\.(com|co\.uk|info|at))(\.|\.?:[0-9]+)$
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]