I develop sites on a Windows machine running LAMP under WampServer. The final sites run on a Linux server. Obviously I want my development environment to match the live environment as closely as possible.
One of the problems I have is that I have been unable to use the same .htaccess file because of the following rule:
I'm not sure how you tested, so I can't really interpret your results...
But make sure that the "www\.example\.com" pattern in the RewriteCond and the "www.example.com" in the RewriteRule substitution URL match exactly, except for the escaping required in the RewriteCond pattern, and be sure to always delete your browser cache before testing any new server-side code.