If you want to redirect http://www.example.com to http://example.com, you can use this:RewriteCond %{HTTP_HOST} ^www\.example\.com$ RewriteRule ^/?$ "http\:\/\/example\.com\/" [R=301,L]- If you want to redirect http://example.com to http://www.example.com, you can use this:RewriteCond %{HTTP_HOST} !^www.example.com$ [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
Monday, March 9, 2015
- Posted By: Unknown
- Comments: 14 comments