This is One Way to Get WordPress MU 2.7 to Properly Install on a WWW Dot Domain Name.
Update Note (May 12, 2007)
Apparently, starting with WordPress MU 2.7.1 this hack is not needed anymore.
What follows is the original post.
Do you need to install WordPress MU on a website that requires using “www” in front of the domain name?
The programmers of WordPress MU 2.7, have set up the installer to not allow you to install on a www.domainname.com, giving the following excuse.
“www. is depreciated has a lot more information on why ‘www.’ isn’t needed any more.”
However, I suspect that the real reason is that they were having trouble with figuring out how to get it to properly run using the “www.” with a domain name when using the “sub-domain” install option. (See Step 3 below.)
This is how I was able to install WordPress MU 2.7 on a “www.domainname.com” and get it running properly.
1. Make it so you can temporarily use yourdomain.com, without the “www.”
(Note: There is a chance that you don’t need to do this. However, you would have to skip Step 4 below.)
2. Install WordPress MU on this domainname.com or domainname.com/subdirectory .
3. When installing, choose the option to use sub-directories. Don’t choose the option to use sub-domains.
(Note: The sub-domains option might work. I didn’t try it.)
4. Log in as admin and make sure it is working.
5. Then in the MySQL database, change every instance of “domain.com” to “www.domain.com.” I did this using “search” in MyPHPAdmin.
6. Edit the “wp-config.php” file. It’s in the main WordPress MU directory.
Find the following line and add in the “www.”
define(’DOMAIN_CURRENT_SITE’, ‘www.domain.com’ );
7. Edit the “wpmu-setting.php” file. It’s in the main WordPress MU directory.
Comment out lines 9 and 10 by inserting // at the beginning of both lines.
(Note: These are the line numbers for WordPress MU Version 2.7 — In other versions, line numbers may be different.)
//if( substr( $domain, 0, 4 ) == ‘www.’ )
// $domain = substr( $domain, 4 );
8. Set the server back to forcing the “www.domain.com.”
9. It should now be working.
Note: In “sub-directory” mode, 404 (Not Found) errors are not properly redirected to the page set for handling such errors. I think that perhaps this is the reason that the programmers of WordPress MU 2.7 suggest installing with the “sub-domain” option.
Thanks to Manoj Kumar for helping me with this.
He has one other method that may work for you if this one doesn’t. See his blog at http://manojkumar.org/install-wordpress-mu-with-www/.