Forcing MU to use www
By default, Mu strips out the www on domain names. I’m not going to get into the debate of for or against, because at some point you just may be forced to use it for reasons beyond your immediate control. Whether you like it or not.
In case you somehow missed catching the the change in the address bar, symptoms may include a redirect error when trying to view the main page, even if it installed fine, and a constant page refresh when trying to login. So watch the address bar and see if it’s adding the www.
After a few eye-bleeding hours searching the forums and the forum tags, I finally found it here. (Did you know there’s actually two ways to search? I should probably write a post on that…)
The thread is a year old and the line numbers are slightly off, but most of it still applies. The rewrite rule to strip www is no longer in the htaccess file so don’t bang your head looking for it.
In my case, I did not want to reinstall again because of the setup it was more work. Here’s what I did:
- go into phpmyadmin and search for all instances of your domain name. Edit them to add the www to the domain name.
- Find wpmu-setting.php in your root folder. Comment out lines 10 and 11 like this:
// if( substr( $domain, 0, 4 ) == 'www.' )
// $domain = substr( $domain, 4 );
Those double-slashes in front of the lines keep that code from being run.
Go test your install, it should be okay. I should also mention that I only tested this on a subfolder install. I have no idea what it does on subdomains.




June 20th, 2008 at 1:41 pm
The problem isn’t one of should have it or shouldn’t have it. The problem is when a server only accepts connects with or without it. The server should be accepting connections in both cases and many of the cases in the forums, the server would only accept a connection with the ‘www’ and would drop the connection without the ‘www.’
That’s when it’s incorrect.
The problem isn’t one of should have it or shouldn’t have it. The problem is when a server only accepts connects with or without it. The server should be accepting connections in both cases and many of the cases in the forums, the server would only accept a connection with the ‘www’ and would drop the connection without the ‘www.’
That’s when it’s incorrect.
July 28th, 2008 at 5:12 pm
Hey I could need some help. I tried to use WPMU 2.6 with http://www.
First I tried the way you described, edited the tables with my domainname in it and commented out the two lines in wpmu-settings. But when I tried to logout I could and was always redirected to the admin panel.
So I tried the way you linked with a new install. Commented out the two lines in wpmu-settings.php and commented out lines 238, 239, 365, 366, 451 and 487 from index-install.php and then installed with http://www.domain.tdl. But after this the loginform looked as though all css infos got lost and when I tried to login I was redirected from http://www.domain.tdl/blogs/wp-login.php to the nonexistent address http: //blogs/wp-login.php (without the space between p and /).
And now I’m stuck…
Hey I could need some help. I tried to use WPMU 2.6 with http://www.
First I tried the way you described, edited the tables with my domainname in it and commented out the two lines in wpmu-settings. But when I tried to logout I could and was always redirected to the admin panel.
So I tried the way you linked with a new install. Commented out the two lines in wpmu-settings.php and commented out lines 238, 239, 365, 366, 451 and 487 from index-install.php and then installed with http://www.domain.tdl. But after this the loginform looked as though all css infos got lost and when I tried to login I was redirected from http://www.domain.tdl/blogs/wp-login.php to the nonexistent address http: //blogs/wp-login.php (without the space between p and /).
And now I’m stuck…
July 29th, 2008 at 2:01 pm
I found out that the logout problem does only occur in the first login after the change without having restart the browser or emtied the cache (dunno whether this will change it)
I found out that the logout problem does only occur in the first login after the change without having restart the browser or emtied the cache (dunno whether this will change it)