/ Published in: Apache
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / # redirect non-www to www RewriteCond %{HTTP_HOST} ^([a-z-]+)\.([a-z]{2,6})$ [NC] RewriteRule ^(.*)$ http://www.%1\.%2/$1 [R=301,L] </IfModule>