Forum Moderators: phranque
RewriteCond %{HTTP_HOST} ^([^.]*).(net|net/)
RewriteRule ^.*$ www.%1.%2%{REQUEST_URI} [R=301,L] !^www..* -- the trailing unactioned .* just wastes processor cycles, literal periods should be escaped, use !^www\. only. ^([^.]*).(net|net/) -- code has multiple issues: escape the literal period, hostname never ends in / here, you need $ end anchor, and [^.]* matches a blank, as in http: // .net -- use ^([^.]+)\.net(:[0-9]+)?$ to also ensure you redirect requests with an appended port number. #this is new and should rewrite example.com to www.example.com
#this is what I already had and works.