With MultiSite it’s a BIT more complicated, since you have multiple places in the database where the domain is set to domain.com.
I would strongly recommend leaving it the heck alone if it’s working. Why do you want to change it?
Thread Starter
MattV
(@mattv)
I´ve moved an exisiting site from a single WP install to WP Multisite. The old URL always had the www included, like: www.domain.com
For continuity I´d like to keep the same URL structure (with the www inluded I mean).
If editing the DB is not a good idea, would any of the other options (htaccess/cname) be a “preferred” solution?
Yeah, it’s not the same thing, editing single site as multisite with those changes.
Frankly, the www doesn’t matter, so long as your old URLs are seamlessly redirected to the new ones.
The best way if you REALLY want to do this is to edit your wp-config and THEN go through the database and find every instance of domain.com and add in www. Then go back and look again, cause you may have missed one.
It’s seriously a pain in the ass. Unless you really, truly, have to. Don’t. if it’s just cause you like www better, I strongly suggest you lean to love sans www 🙂 Any mismatch, any missed file, can cause your site to break. Badly.
Thread Starter
MattV
(@mattv)
Ok that´s very clear 🙂
So far I´ve this:
- htaccess: no option, this will cause an infinite redirect loop
- wp databse: very risky, better not mess with it
Would the other options be a solution? (Point 3 and 4 in my first post: a new entry in the domain mapping plugin or adding a CNAME record)
(There are so many questions regarding this topic that I thought it would be good to cover all the options in one single thread. Also for others who´ll have the same question. I really aprictae your help!!
– Thanks!)
Domain mapping or CNAME MIGHT work, but it also may cause the same problem as htaccess :/ You’ll have to test and check, as I’ve not tried them. I HAVE done the domain, and it’s a pain.
Use the Domain mapping plugin: add a new entry http://www.mainsite.com, with the same Site ID as the mainsite.com entry.
this is the simplest solution. if you’re mapping the site already, you can just add the domain again with the www.
Thread Starter
MattV
(@mattv)
Thanks Ipstenu & Andrea, it´s very clear now!
Anyone an idea how to fix this for the primary URL?
Since this is site ID 1, I tried to add http://www.mydomain.com and set it as primary. But the record isn’t saved.
Most important is that my main site shows: http://www.mydomain.com instead of mydomain.com
ruben86 – This topic is marked resolved, which means you need to make your OWN topic for yourself 🙂
You can’t map the MAIN URL via the domain mapping plugin. You would need to essentially change the URL on your site, and it’s a pain in the butt.
Oh, sorry! In that case I leave it as it is… Thanks anyway