Rewriting domain only if not on local dev enviroment and forcing www with Mod Rewrite I'm trying to write some mod rewrite code to redirect pages on a site to always use www and this has been working fine:

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


However, I now want to make sure this doesn't happen on my dev environment, which uses the .local domain extension...

So I changed it to this:

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


Does that seem correct?

As I understand it, it states: "If it doesn't END with .local AND it doesn't START with www. THEN do the RewriteRule"?
Yes! That is indeed correct. From the docs for RewriteCond:


  'ornext|OR' (or next condition)
  
  Use this to combine rule conditions with a local OR instead of the
  implicit AND.


The [AND] flag is the default behaviour of combining multiple conditions expressions together.

As for the rule itself, I'd suggest using %{REQUEST_URI} instead of $1 in rewrites:

RewriteCond %{HTTP_HOST} !\.local$
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]