/ Published in: Apache
I like using HTTP_HOST with a simple regex 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://%1/$1 [L,R=301]