redirect non www site to www site with 301 status
Hi Folks,
I want to redirect my non www site to www site every time as google suggests.
I have RHEL 6.3(x86_64) and apache version : Apache/2.2.15,
I have created following rule in .htaccess file but it is not working for me and showing nothing and keeps refreshing page again and again, looks like looping.
Please guide me how can I achive this.
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.xyz\.com
RewriteRule (.*) http://www.xyz.com/$1 [R=301,L]
|