WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Move from non-www domain to www domain (9 posts)

  1. epschmidt
    Member
    Posted 4 years ago #

    Posted this yesterday in the general support forum before remembering there was a multisite forum:

    To use an existing SSL certificate I need to move our site from not using www by default to use www so we don't get security errors. I'm running 3.0 Multisite with the Domain Mapping plugin. I had WP-Super Cache but disabled it and deleted the cache files for the time being.

    I've tried search and replace for domain.com and replacing with http://www.domain.com on the database as well as adding the following redirect rule to .htaccess.

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

    Neither have worked. If i just do the .htaccess redirect, it produces a redirect loop. If I do the search and replace adding http://www.domain.com to the database along with the .htaccess redirect, all pages and links are redirected back to the homepage. Am I missing something? Is there a different way to do it with a multisite setup?

  2. Check your wp-config.php file for what the basic name is? I think you have a DOMAIN_CURRENT_SITE as domain.com and not http://www.domain.com?

  3. epschmidt
    Member
    Posted 4 years ago #

    I believe I tried changing that, but I set the DOMAIN_CURRENT_SITE as "www.domain.com".

    Should it be the full url? http://www.domain.com?

  4. epschmidt
    Member
    Posted 4 years ago #

    Also, in researching I came across this post from Andrea on this issue for WPMU, http://wpmututorials.com/hacks/forcing-mu-to-use-www/.

    I started the site in MU and have since upgraded to 3.0. She mentions the problem in her post will be fixed with 3.0, but I still have the wpmu-settings.php file in my root folder. Is this safe to remove? Or do I need to keep it since I've upgraded from MU and did not do a clean install?

  5. Should be WITHOUT the http:// -- The forum changes it for me!

    Under Super Admin -> Sites, click on Edit for your main site and check what the URL is. Mine is domain.com (since I don't like the www). Yours should be www. obviously. Just making sure it's everywhere.

    I think you can get rid of that file. Try renaming it to .txt to see what happens?

  6. epschmidt
    Member
    Posted 4 years ago #

    OK, I think I got it almost working. I changed the DOMAIN_CURRENT_SIte to "www.domain.com" and also did a search/replace through the database to update the urls to "www.domain.com". Now entering domain.com, you are redirected correctly to http://www.domain.com, and all the links on the page work correctly leading to http://www.domain.com.

    One problem remains, trying to enter a page's url directly, like domain.com/about/ only leads back to http://www.domain.com. Would I have to do something in .htaccess to get these to direct to the right place?

    Side Note: When I first made the changes, my admin links all lead to my home page. But removing or renaming wpmu-settings.php like you suggested took care of that with no apparent side effects. I must have mistakenly left that in my root folder when I did the upgrade.

    Thanks for your help.

  7. Where did you put your .htaccess rule? Above the WordPress section?

    I use the same one (backwards) and it works fine.

  8. epschmidt
    Member
    Posted 4 years ago #

    I had taken that .htaccess redirect out to prevent a redirect loop, but when I put it back in, all is working as expected. Thanks again for your help.

  9. Also, in researching I came across this post from Andrea on this issue for WPMU, http://wpmututorials.com/hacks/forcing-mu-to-use-www/.

    This is old old old and no longer relevant for this version. It *will* handle the www.

Topic Closed

This topic has been closed to new replies.

About this Topic