1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Domain displayed without www.

Discussion in 'Web Hosting' started by ashley777, Aug 27, 2011.

  1. ashley777

    ashley777 Junior Member

    Joined:
    Aug 30, 2010
    Messages:
    138
    Likes Received:
    17
    Hello,

    I have a very big problem. I setup a server, bought a domain from a different source and everything is running so far.
    But whenever I want to open w*w.testpage.c*om it just opens testpage.c*m :confused: Someone told me I have to modify .htaccess - but where and how?
    I did google search but could'nt find anything.
    Thanks in advance.

    Best regards:)
     
  2. SahL

    SahL Elite Member

    Joined:
    Jan 8, 2011
    Messages:
    1,594
    Likes Received:
    1,296
    Occupation:
    ★SEO expert and ★Sexpert
    Location:
    Bombay
    Home Page:
    Ask your web host to redirect the non www url to the www url.

    maybe you cannot access .htaccess.
     
  3. ashley777

    ashley777 Junior Member

    Joined:
    Aug 30, 2010
    Messages:
    138
    Likes Received:
    17
    I can access .htaccess - but it is very weird.
    When I do backlinks now should I use the www. or not?
     
  4. extremephp

    extremephp BANNED BANNED

    Joined:
    Oct 19, 2010
    Messages:
    1,293
    Likes Received:
    1,272
    Here you go :

    http://www.blackhatworld.com/blackhat-seo/white-hat-seo/258855-redirection-301-htaccess-tutorial.html
     
    • Thanks Thanks x 1
  5. Kaistar

    Kaistar Power Member

    Joined:
    Jan 9, 2010
    Messages:
    562
    Likes Received:
    333
    Create a text file called htaccess.txt and put this inside it...
    Code:
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} !^www.yourdomain.com$ [NC]
    RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]
    Then upload it to the root of your hosting.

    After uploading rename it to .htaccess

    Note the . at the beginning and no extention, it MUST be called .htaccess

    **Edit**
    I see you can access your file so just edit it to include that code...
    Once you include that code your page will open as www. and backlinks should reflect this.
     
    • Thanks Thanks x 1
    Last edited: Aug 27, 2011
  6. SahL

    SahL Elite Member

    Joined:
    Jan 8, 2011
    Messages:
    1,594
    Likes Received:
    1,296
    Occupation:
    ★SEO expert and ★Sexpert
    Location:
    Bombay
    Home Page:
    Use the non www url for BACKLINKING , which is showing right now.


    and if you access to .htaccess

    add this code

    Code:
    RewriteEngine on 
    RewriteCond %{htTP_HOST} ^example\.com 
    RewriteRule (.*) http://www.example.com/$1 [R=301,L]
    replace example with your site.

    to make the site go to w*w.testpage.c*m
     
    • Thanks Thanks x 1
    Last edited: Aug 27, 2011
  7. ashley777

    ashley777 Junior Member

    Joined:
    Aug 30, 2010
    Messages:
    138
    Likes Received:
    17
    Man I thank you all so much - its great to be here.

    So can I leave it like this:

     
  8. Kaistar

    Kaistar Power Member

    Joined:
    Jan 9, 2010
    Messages:
    562
    Likes Received:
    333
    Does it redirect your site to the www. version if you just type http://site.com ?
     
  9. ashley777

    ashley777 Junior Member

    Joined:
    Aug 30, 2010
    Messages:
    138
    Likes Received:
    17
    No, then its going to http://site.com as well.
     
  10. Kaistar

    Kaistar Power Member

    Joined:
    Jan 9, 2010
    Messages:
    562
    Likes Received:
    333
    Then the redirect code you are using is wrong. Try the one I posted if you want it to redirect to the www. version.

    Although I don't know how your server will handle the fact that you have both rewrite on and off.
    Someone else will have to work that one out if it still doesn't work.
     
  11. moneymachine01

    moneymachine01 Regular Member

    Joined:
    Sep 2, 2009
    Messages:
    339
    Likes Received:
    75
    Why does it matter at all ?
     
  12. Kaistar

    Kaistar Power Member

    Joined:
    Jan 9, 2010
    Messages:
    562
    Likes Received:
    333
    Because Google treats both addresses as separate sites.
    http://address and http://www.address are both different and backlinks to one won't count on the other.
    On top of this you risk duplicate content because they are effectively separate sites with the same content.
     
  13. steviep

    steviep Junior Member

    Joined:
    Oct 25, 2010
    Messages:
    121
    Likes Received:
    27
    Occupation:
    Founder & Managing Director - SEOSPIN.net
    Location:
    Stoke on Trent - UK
    Home Page:

    you dont want to spread linkjuice to two different sites.

    domain.com and www.domain.com are technically two different websites, you could have on domain.com a sportspage and on www.domain.com a homer simpson dedictated fanpage...
     
  14. phluid

    phluid Power Member

    Joined:
    Jan 25, 2011
    Messages:
    749
    Likes Received:
    340
    Is your site running wordpress? If so everyone is giving you the complicated way, you can chance it in your general settings. If you are not using wordpress then you can go the .htaccess route.
     
  15. Kaistar

    Kaistar Power Member

    Joined:
    Jan 9, 2010
    Messages:
    562
    Likes Received:
    333
    Not seen this one before, got an example ?
     
  16. ashley777

    ashley777 Junior Member

    Joined:
    Aug 30, 2010
    Messages:
    138
    Likes Received:
    17
    This one site is running WP, yes. But I want other blogs and pages there as well.
     
  17. phluid

    phluid Power Member

    Joined:
    Jan 25, 2011
    Messages:
    749
    Likes Received:
    340
    If running Wordpress then just click General, then settings. Once you get there change WordPress address (URL) and Site address (URL). Put a www. in front of the domain name and you should be good to go. However, I have noticed if you don't do this from the very start that it can cause some weird indexing issues that don't seem to straighten out for a while.
     
    • Thanks Thanks x 1
  18. yesrams

    yesrams Regular Member

    Joined:
    Dec 16, 2009
    Messages:
    354
    Likes Received:
    75
    Location:
    @BHW
    Yes this is the correct solution. I assume you already changed htaccess like above com mentors said.


     
  19. Kaistar

    Kaistar Power Member

    Joined:
    Jan 9, 2010
    Messages:
    562
    Likes Received:
    333
    Let's be fair now, the original post said he set up a server and was told he needed to edit .htaccess ... He got instruction to do just that. Any mention of Wordpress would have brought different instructions ;-)

    Anyway, done now and he did say that there would be other platforms being used as well so he's gonna need to know how to do it manually anyway :)
     
    • Thanks Thanks x 1
  20. ashley777

    ashley777 Junior Member

    Joined:
    Aug 30, 2010
    Messages:
    138
    Likes Received:
    17
    100% - did it - working now perfect !!!

    BHW is just awesome - thanks to all of your for this not normal super fast support !!! :pirate: