How to add www to domain name?

8 replies
Hi,

I just wondering how to add www before my domain name? I found in google that needs to add in .htaccess file this code:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.yoursite.com$
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [R=301,L]
But for me doesn't work, error message: "Too many redirects occurred trying to open http://www.findwebsite.net. Any ideas how to change? Or may I put this code in wrong line?

My domain: findwebsite.net
#add #domain #www
  • If you are using wordpress, it adds the redirection to the .htaccess file. Simply choose the correct domain name in the admin panel and it takes care of everything else. Adding code to the .htaccess file might mess things up instead of fix it.
    Signature
    Arnold Stolting - Stolting Media Group
    "I LOVE The Song! The Vibe Is Positive And Firm!" - Kymani Marley. (Son of Bob Marley).

    "Very High Quality!" Jeremy Harding - Manager / Producer. Sean Paul.
    "They Are FANTASTIC!" - Willie Crawford.

    {{ DiscussionBoard.errors[8385497].message }}
  • Profile picture of the author John Romaine
    Sounds like you have conflicting (multiple) redirects going on.
    Signature

    BS free SEO services, training and advice - SEO Point

    {{ DiscussionBoard.errors[8385502].message }}
    • Profile picture of the author tomukasteris
      Originally Posted by John Romaine View Post

      Sounds like you have conflicting (multiple) redirects going on.
      And how to fix this problem? I am using eSyndiCat Directory script.
      {{ DiscussionBoard.errors[8385526].message }}
  • Profile picture of the author Wayne
    If you're trying to force www when people visit your site without the www, I think the code should be like this:

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

    Replace example.com with your domain. I think the problem with your code is you included
    www in the RewriteCond line, this line should not include the www.
    How to force www or non-www in htaccess | InMotion Hosting
    {{ DiscussionBoard.errors[8385556].message }}
    • Profile picture of the author tomukasteris
      Originally Posted by Wayne View Post

      If you're trying to force www when people visit your site without the www, I think the code should be like this:

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

      Replace example.com with your domain. I think the problem with your code is you included
      www in the RewriteCond line, this line should not include the www.
      How to force www or non-www in htaccess | InMotion Hosting
      I tried this and do not work. What I am doing wrong?
      {{ DiscussionBoard.errors[8385849].message }}
      • Profile picture of the author IMkayo
        The following syntax works for me:

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

        Make sure there are no other rewrite conditions/rules in the .htaccess file that may conflict with your redirect.
        {{ DiscussionBoard.errors[8386145].message }}
  • Profile picture of the author bluefire2121
    I'm a software developer. Just ping me and I'll walk you through adding www., sub-domains, and https SSL certification on your site. Email: bluefire2121@yahoo.com
    {{ DiscussionBoard.errors[8386214].message }}
    • Profile picture of the author tomukasteris
      Originally Posted by bluefire2121 View Post

      I'm a software developer. Just ping me and I'll walk you through adding www., sub-domains, and https SSL certification on your site. Email: bluefire2121@yahoo.com
      Thanks, but I sorted this problem. I just deleted my addon domain and created new with www. Now is ok.
      {{ DiscussionBoard.errors[8386290].message }}

Trending Topics