-1

I was wondering on how would I make my non-www domain would be direct to www domain. I've tried to configure my .htacces to redirect my non-www to www but since non-www was defualt it was infinitely looping to each other. How am I going to resolve this? Thanks

    #Force www:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301,NC]

I wanted to make my domain SEO friendly, what should I do? should I add WWW as a CNAME or as a A My wordpress files were in public_html, do I have to make a new subfolder to do this kind of canonical?

masegaloeh
  • 17,978
  • 9
  • 56
  • 104
  • More information needed. Can you show the contents of your .htaccess? –  Mar 01 '15 at 14:20

2 Answers2

0

I have this and it works for me:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

Replace example.com with your domain.

Andrew B
  • 31,858
  • 12
  • 90
  • 128
0

I have this works for me

RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]

I don't think making subfolder is a good solution for SEO. URL Rewrite works well in this situation as you see another one does. Please see more about URL Rewrite .

The advantages of using CNAME is that when you want to changes IP ( or add more IP in DNS Round Robin) , you need to change only 1 A Records instead of Lots of A Records. Not in SEO.

Summer Nguyen
  • 214
  • 3
  • 10