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

why does WP default to http://domain.com instead of http://www.domain.com?

Discussion in 'Blogging' started by mollah, Apr 27, 2009.

  1. mollah

    mollah Power Member

    Joined:
    Feb 11, 2009
    Messages:
    674
    Likes Received:
    555
    and is there any way to change it?

    I tried to change it in WP dashboard last time (added the www's) and ended up crashing my server and having to have hostgator support fix it for me :eek:
     
  2. K1w12k3

    K1w12k3 Junior Member

    Joined:
    Feb 13, 2009
    Messages:
    116
    Likes Received:
    393
    Home Page:
    It's under Settings/General in the admin section.
     
  3. neo

    neo Power Member

    Joined:
    May 5, 2007
    Messages:
    506
    Likes Received:
    368
    I don't think your server will crash if you add www in the general setting option in your wordpress dash board. It could be some other issue.
     
  4. mollah

    mollah Power Member

    Joined:
    Feb 11, 2009
    Messages:
    674
    Likes Received:
    555
    Are you referring to the "WordPress Address URL" field? Or the "Blog Address URL" field?

    IIRC, changing one of them did nothing, changing the other one (or both) caused it to crash (unfortunately I can't remember which was which). When it was changed to include the www's, when I would try to access my site (or dashboard) it would say:

    "cannot resolve http://.mydomain.com"

    It was trying to begin with a dot (see how it's http colon slash slash dot my domain). At first I thought maybe I just forgot the "www," and just started with the dot, but I didn't.

    I tried this on two separate domains and it had the same result on each. They both had to be "reset" by hacking the .htaccess file


    Oh wait, you know what? I made those changes on a third domain and it worked just fine. I just checked.

    So I have no idea why the two most recent domains I tried to change it on didn't work :pcguru:
     
  5. denharsh

    denharsh Newbie

    Joined:
    Apr 28, 2009
    Messages:
    25
    Likes Received:
    1
    Home Page:
    You can also consider editing your .htaccess file to redirecting all link targeting fro yourdomain . com to www . yourdomain .com
     
  6. neobyte

    neobyte Junior Member

    Joined:
    Sep 15, 2008
    Messages:
    122
    Likes Received:
    16
    It is just configured that way, you can change your setting to redirect from www subdomain to your main site though.

    put the following line into your .htaccess file:

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

    This basically redirect all the traffic from subdomain www.domain.com to your main site, domain.com.