This is an Apache question you\'ve probably come across before. I want to have one source package that I can deploy to my workstation, my staging server, and my production s
Here is a simple example that should be enough for you to change it to meet your requirements:
RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^localhost RewriteCond %{HTTP_HOST} !^www\. RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [R=301,L]