Page 1 of 2 12 LastLast
Results 1 to 10 of 31

Thread: Make domain.com point to www.domain.com

Hybrid View

  1. #1
    Join Date
    Feb 2006
    Location
    Somewhere where I don't know where I am
    Posts
    2,155

    Default How To make domain.com point to www.domain.com

    Open or create a .htaccess file in the /public_html/ directory (if the domain is an add-on domain, then the .htaccess file will be located in add-on domain's directory)

    Put this at the top of the .htaccess file (replacing 'domain' with yours)

    Code:
    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{HTTP_HOST} ^domain.com [nc]
    rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]
    Last edited by areidmtm; 01-16-2008 at 03:05 PM.
    Sign Up Now!
    Unlimited Storage, Unlimited Transfer, Host Unlimited domain names, 1 Free Domain Name
    BlueHost Features | BlueHost Help Desk | Become a BlueHost Affiliate | BlueHost CEO Blog
    (888) 401-4678 | Create a support ticket

  2. #2
    Join Date
    Feb 2006
    Location
    Florida, USA
    Posts
    1,505

    Default

    And of course the opposite..
    Code:
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [nc]
    RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]

  3. #3
    Join Date
    Jan 2008
    Location
    Brazil
    Posts
    21

    Default

    For me it doesnt work. I get a page that says that "This site was moved to this location" and the word "this" is a link to "domain.com" and get an infinite loop.

    [EDIT]

    Forget. It was a conflict between the wordpress config and .htaccess settings. Changed it in Wordpress Admin Panel and everything is ok.
    Last edited by Diogenes; 01-30-2008 at 04:10 PM.

  4. #4
    Join Date
    Feb 2008
    Posts
    3

    Default

    Another newbie here.

    I've tried to insert your text into a new .htaccess but changing the suffix from ".com" to ".co.uk" however it seems to be redirecting to the ".com".

    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{HTTP_HOST} ^mydomain.co.uk [nc]
    rewriterule ^(.*)$ http://www.mydomain.co.uk/$1 [r=301,nc]


    Is there something else I've missed?

  5. #5
    Join Date
    Feb 2006
    Location
    Florida, USA
    Posts
    1,505

    Default

    Only if something else is redirecting it.

  6. #6
    Join Date
    Jan 2008
    Location
    Sialkot
    Posts
    7

    Default

    Not working for me, site is not opening check www.smsdad.com or check without www site is not opening.("Add-on domain" .htaccess file created in add-on domain directory)

  7. #7

    Default

    Quote Originally Posted by andyv View Post
    Another newbie here.

    I've tried to insert your text into a new .htaccess but changing the suffix from ".com" to ".co.uk" however it seems to be redirecting to the ".com".

    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{HTTP_HOST} ^mydomain.co.uk [nc]
    rewriterule ^(.*)$ http://www.mydomain.co.uk/$1 [r=301,nc]


    Is there something else I've missed?
    You need to place a \ backslash before the periods on the rewritecond. The following is an example of what is working for my site
    rewritecond %{HTTP_HOST} ^example\.org [nc]
    rewriterule ^(.*)$ http://www.example.org/$1 [r=301,nc]

    Try this for your site
    rewritecond %{HTTP_HOST} ^mydomain\.co\.uk [nc]

    The Apache writeup
    http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html

  8. #8
    Join Date
    Jan 2008
    Location
    Sialkot
    Posts
    7

    Unhappy

    Quote Originally Posted by arnb View Post
    You need to place a \ backslash before the periods on the rewritecond. The following is an example of what is working for my site
    rewritecond %{HTTP_HOST} ^example\.org [nc]
    rewriterule ^(.*)$ http://www.example.org/$1 [r=301,nc]

    Try this for your site
    rewritecond %{HTTP_HOST} ^mydomain\.co\.uk [nc]

    The Apache writeup
    http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
    Still not loading my site. oh God wts problem there

  9. #9
    Join Date
    Apr 2008
    Posts
    1

    Default

    Quote Originally Posted by areidmtm View Post
    Open or create a .htaccess file in the /public_html/ directory (if the domain is an add-on domain, then the .htaccess file will be located in add-on domain's directory)

    Put this at the top of the .htaccess file (replacing 'domain' with yours)

    Code:
    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{HTTP_HOST} ^domain.com [nc]
    rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]
    I'm sorry, and I know this has been asked before. I registered with godaddy, but then purchased the webhosting from BlueHost. How can I pull my domain from godaddy to bluehost?? YES, serious noob.

  10. #10
    Join Date
    Nov 2006
    Location
    Sydney, Australia
    Posts
    4,951

    Default

    Quote Originally Posted by jdozer View Post
    I'm sorry, and I know this has been asked before. I registered with godaddy, but then purchased the webhosting from BlueHost. How can I pull my domain from godaddy to bluehost?? YES, serious noob.
    You edit the nameservers to change them to point to ns1.bluehost.com and ns2.bluehost.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •