/ Published in: Apache
![](/img/icon_sav.png?v3)
I like using HTTP_HOST so it'll work in multiple environments, ie stage, production, dev, etc.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
RewriteEngine on RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [L,R=301]
Comments
![RSS Feed for Comments RSS Icon](/images/rss.png?v3)