The MU forums have moved to WordPress.org

Change from mysite.com to www.mysite.com (18 posts)

  1. jwack
    Member
    Posted 10 years ago #

    I setup the site without www and would like to add them in. I am finding a lot of info on the subject but not sure what to do.

    If someone could point me in the right direction I'd be greatful.

  2. dgilmour
    Member
    Posted 10 years ago #

    There's also a good discussion on it here, with some specifics for a subfolder install: http://wpmututorials.com/hacks/forcing-mu-to-use-www/

  3. jwack
    Member
    Posted 10 years ago #

    Thanks for the link!

    I am using sub-domains and he says in the post that he tested it on sub-folders. There is no real reason for me to add the www besides I think it makes more sense, so I guess I will just leave it as is.

  4. andrea_r
    Moderator
    Posted 10 years ago #

    That's old info, no longer current and will not work.

    Wait for 3.0. that'd be the easiest to do.

  5. alisondoyle
    Member
    Posted 10 years ago #

    just curious why would you want to add the www?

  6. dgilmour
    Member
    Posted 10 years ago #

    It's quite common for people to add "www" to the URL in error if they've no experience of sites without it. I guess site owners might want to allow for that and prevent the user just getting a "not found" error.

  7. alisondoyle
    Member
    Posted 10 years ago #

    oh right, that makes sense.

    jwack, you might want to consider setting up the www prefix and then setting a 301 redirect to domain.com

    google considers www,domain.com and domain.com as two different urls. By using the 301 redirect, you won't combine the pagerank of both urls to one page. Google webmaster tools has a nice feature that lets you send traffic from other urls to your preferred url.

    Check out the best answer to this google question for some relevant links:
    The www prefix and its effect on pagerank

  8. jwack
    Member
    Posted 10 years ago #

    The site is currently setup to redirect all http://www.mydomain.com to mydomain.com. I just want that reversed. Wordpress is controlling this correct? I tried to setup the redirect in my htaccess file and just got an error.

  9. alisondoyle
    Member
    Posted 10 years ago #

    i think it would be your hosting configuration that controls that, unless you've installed some sort of plugin to control redirects.

    How come you want to reverse it?

  10. alisondoyle
    Member
    Posted 10 years ago #

    oh and i just realized there was a typo in my post about 301 redirects.

    I meant to say that by using 301 redirects, you WILL combine the pagerank of both urls to one page.

  11. jwack
    Member
    Posted 10 years ago #

    "How come you want to reverse it?"
    - No particular reason really, most large sites I see have the www

    "i think it would be your hosting configuration that controls that"
    - Actually I'm running the site off my personal server, and I am pretty sure it's a WP thing. I tried switching it from within the server and WP didn't like it.

    Guess I will leave it or wait till 3.0 like andrea_r suggested.

  12. DrLightman
    Member
    Posted 10 years ago #

    I also have to add www to Donncha's domain mapped. (I wouldn't, but It's been asked and I HAVE to do :| ... )

    I commented out the lines from wpmu-settings.php:

    //if( substr( $domain, 0, 4 ) == 'www.' )
    //	$domain = substr( $domain, 4 );

    I manually edited the domain mapping entry from the db in wp_domain_mapping table:

    example.com to http://www.example.com

    Now if I load the http://www.example.com it redirects to:

    http://main.wpmusite.com/wp-signup.php?new=www.example.com

    Any ideas on how to finalized the pro-www hack? :(

    edit: I found the latest lines to edit in sunrise.php:

    line11: $dm_domain = $wpdb->escape( $_SERVER[ 'HTTP_HOST' ] );

    Now it works, my domain mapped holds www.

  13. ancawonka
    Member
    Posted 10 years ago #

    THANK YOU DrLightman! The domain I'm working on points to different addresses for http://www.mydomain.com and mydomain.com. Your fix seems to do the trick.

  14. empius
    Member
    Posted 10 years ago #

    Wordpress allows you to make this change through settings > General in the Admin Panel. But Wordpress Mu doesn't give you this option. I wanted my site visitors to be taken to http://www.nigerianpost.com even when they type nigerianpost.com (without the www). This offers your site some SEO benefits.

    The following link shows how I fixed the issue.

    http://www.innovativeiteam.com/2010/05/how-to-change-your-wpmu-domain-url/

  15. Ovidiu
    Member
    Posted 10 years ago #

    @Andreea:

    why wait for 3.0? is there an easy way to decide with or without WWW without a hack?

  16. andrea_r
    Moderator
    Posted 10 years ago #

    Becasue 3.0 lets you use either, and if you're still in MU, it strips it out. gotta hack mu.

    So the "easy without a hack" way is do it in 3.0. It's coming out real soon now.

  17. Ovidiu
    Member
    Posted 10 years ago #

    currently setting up a client's site on 3.0 beta2. not upgraded yet to RC.

    Where exactly will this new setting be found in 3.0? any more info on it?

  18. andrea_r
    Moderator
    Posted 10 years ago #

    It's not a setting. If your server / install is on a www domain, it will detect it automatically.

About this Topic