The MU forums have moved to

Blog urls that start with 'www.' (39 posts)

  1. ivanhoe
    Posted 18 years ago #

    Hello all,
    I've got the following problem

    By default, url for main (and only, for now) blog was, and it all worked well like that. But I need to have url fr blog with 'www' part infront, to integrate with the rest of the site. After changing blog's url to, all I got was "Couldn't find blog" Errors.

    I noticed it seems that it's hardcoded in wp_settings.php to strip 'www.' part from the domain name, making it impossible to find any blog with 'www.' in url?

    I tried commenting out this two lines, and that worked partially, since now I get home page for blog (no errors), but no posts are visible on it, I just get home page as it was no posts at all (and ofcourse I doublechecked DB, and they're sitting there). However, I don't like this type of hacks, I'd rather try to solve this some other way. Just I've got no idea how?

    The other strange thing are these 2 .htaccess lines:
    RewriteCond %{HTTP_} ^www\.(.*)
    RewriteRule ^(.*) http://%1/$1 [R,L]

    is this supposed to be like this?
    I used RewriteLog to debug what's going on and it seems these lines never match anything (and I believe they should, since url of the page was

    I'm totally new with wordpressMU, so any suggestion will be of great help to me..



  2. TwisterMc
    Posted 18 years ago #

    I tried to force the WWW in with the .htaccess code and it worked great in Firefox, however IE wouldn't load any style sheets!! I'd rather have the www but it just doesn't work with it.

  3. jaseone
    Posted 18 years ago #

    Actually using www is deprecated anyway.

  4. TwisterMc
    Posted 18 years ago #

    I was kind of hoping that I could get a choice if wanted the WWW or not. I guess it still works and that's what counts.

  5. ivanhoe
    Posted 18 years ago #

    jaseone: in my experience, 99% of visitors will type http://www.something.. in their browsers, ppl are just used to web addresses starting with 'www.' and also browser's shortcut CTRL+ENTER adds www automaticly...not to mention that most of the email clients don't recognise as a link, but all of them knows that is a link, and you'll be able to click on it directly even in a plain text email...

    therefor I believe it's much smarter & more useful to redirect visitors other way around, from -> Has a same positive effect (universal way to access the site), but saves your server a lots of redirects, since most of the folks will go directly to anyway..

  6. gappiah
    Posted 18 years ago #

    I find this rather strange, as most hosts / domain registrars, by default, forward to

    Have you checked your domain name's DNS host address settings?.

  7. m8rk
    Posted 17 years ago #

    Our County Council uses the non 'www' address for the intranet link, so I have no option but to use the www address for my site - I need to change the config to remove the rewrite - I've tried modifying .htaccess but that doesn't work. Can anyone help please?

  8. schun
    Posted 17 years ago #

    I have the same issue as m8rk. Does anyone have any idea how to fix this?


  9. corourke
    Posted 17 years ago #

    Strictly speaking for an intranet it should be set as "" on the server for maximum security AND proper network architecture. If you're running on a Win2k DC that's the Microsoft recommended method.
    Granted that's a bit out of the scope of your question since it's required by the county council.
    (yay MCSE and 10 years working with M$)

    Most webhosts (good ones that is) automatically setup domains so it works with or without the deprecated www

    A possible workaround would be to add an ip redirect to the htacess. Any of the ip's coming from the council network would redirect to the www page while everyone else would ignore it and go to the actual blog

  10. m8rk
    Posted 17 years ago #

    Thanks corourke for your suggestion

    I have employed such shinanegans in the past to redirect IPs according to source, when setting up sites on the internal, reverse proxy site, but how does that help me here?

    The site is broken from both sources.

    The site i'm hoping to set this up on is on the external www space, and not the internal no www space.

    Because the default install tries to redirect to the non www space, which is a totally different server, located within the WAN, it doesn't work.

    Please help... more! :)

    here's the site:


    I removed the .htaccess content all together and it almost works. The css doesn't apply to start with.

    The site is a subdomain of the main domain, and the blogs have to be in a subdirectory. Am I asking too much of MU?

  11. corourke
    Posted 17 years ago #

    Hmm the method I suggested would just send all external users into a redirect loop of neverending doom..

    Do you have admin access on the intranet server?

  12. m8rk
    Posted 17 years ago #

    Yes - full admin to intranet - subdomain admin to the web server

    I tried a replacement .htaccess from these forums previously that was intended to reverse the www > - but got no joy from that. Perhaps now that i'm getting somewhere with this subdomain AND sub-folder I should try that again. /wherever it was! :)


    ok - I don't get the subdomain subfolder bit either!

  13. zylstra
    Posted 17 years ago #

    jaseone and corourke,
    Can you provide an authoritative link that says that www is deprecated? And, no, is not authoritative.

  14. m8rk
    Posted 17 years ago #

    I'm trying this from here [ ]

    Under >>Site Admin >> Blogs >> Edit Main Blog

    Change the field "Home" from: to

    Then in your http access file replace:

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


    RewriteCond %{HTTP_HOST} ^domain\.com
    RewriteRule ^(.*)$$1 [R=permanent,L]


    So do I put?:

    RewriteCond %{HTTP_HOST} ^newtown-hs.powys.sch\.uk
    RewriteRule ^(.*)$$1 [R=permanent,L]

  15. corourke
    Posted 17 years ago #

    I'm using it in the sense that is not needed any longer. All webpages should be able to be viewed without the www


    You want the intranet users to use: so set the dns as such instead of just (change intranet to anything you want)

    For the htaccess leave it as is and then just plunk a tiny link to the new intranet address onto the main blog page. That's the fastest way to do it I can think of.

    That way it keeps internal in a closed dns system and external properly external. mixing it the way it is now will only cause problems like this :D

  16. m8rk
    Posted 17 years ago #

    Thanks so much corourke

    I think you misunderstand. We have 2 web severs - an intranet AND a web server. I'm setting up the MU site on the webserver - and don't want any links at all to the intranet server - I don't want to touch that.

    My problem is that the intranet server is on a reverse proxy, and uses the non www domain name. internally you get to it using the address:


    The web server therefore, only uses the www name, and does not have the non www link pointing to it. Hence my problems getting MU to work.

    My second problem is that as I'm allready on a sub-domain, I also need to use both subdomain AND subdirectory for the MU site. I want it to work from:

    The setup gives you the choice of either, but not both!

    Hope that's clear! :)

  17. corourke
    Posted 17 years ago #

    I have no idea how to get the subdomains and subfolders working together.

    Set the ip for the webserver in your intranet dc dns to handle http lookups as well as changing the intranet url to use intranet for all internal www

    Keeping them separate is the sturdiest most bulletproof method to maintaining a network. The network I run right now has an internal intranet and external site on it's own webserver.

    The dns entries for the intranet are:

  18. m8rk
    Posted 17 years ago #

    Thanks corourke, you've given me ideas there - i'l work on it.

    Many thanks

  19. ValePekeno
    Posted 17 years ago #

    Hello. I had a similar problem. I had to install wpmu in a web server that only have a dns direction with a www. before. Installation worked fine if I put the ip instead of the domain name, but every time I've installed it with the domain I had problems.
    I just fixed it doing 4 steps:
    1. Commenting two first lines in htaccess_dist, then when the install script creates .htaccess these lines are commented.
    2. Commenting lines 366 and 367 in index-install.php because it drops "www." from the domain name before inserting it in the database.
    3. Installing wpmu with subdirectories, putting in the site name the domain with www. After it, scripts will generate correct links to the wpmu main blog.
    4. At this point, in my case, when I were trying to go to the main blog I only got a infinite loop of redirections between and I fixed it commenting lines 8 and 9 in wpmu-settings.php, which were removing again www. from the domain name.

    Finally, I have to say that I don't understand the reason of drop this domain in some different places once and again. There are people that don't have other way to run wpmu.


  20. lunabyte
    Posted 17 years ago #

    Sure you do, put it on a subdomain.

  21. ValePekeno
    Posted 17 years ago #

    These server doesn't admit subdomains, all the subwebs are in subdirectories. It is there because they want to give a corporative image (all subweb names after the main domain) and because there are subdomains in the form, but all of it are different servers. It is an university net, and schools that have their own server have a subdomain.
    So I put it here because there can be someone with the same problem and I hope this helps, but I know that in other cases it may not work.

  22. rcain
    Posted 15 years ago #

    regardless of the WP technical implementation details of 'www' Vs 'no-www' Vs, i thought it might be helpful to tail this forum thread with an observation:

    although sites such as are not actually 'wrong' in advocating their 'B' class url: www->no-www, there are yet other groups advocating the opposite.

    Notably, the w3c themselves still advertise themselves and their own links using the www prefix (see here for example - whilst the standard URL/URI syntax has never actually required it ( see here - ).

    hope this clears any confusion on standards for the while.

  23. tdjcbe
    Posted 15 years ago #


    Please let it die. Everyone has their own opinion, no one is right or wrong.


  24. thelaw
    Posted 15 years ago #

    The fact that Wordpress MU doesn't allow you to have an opinion is really the problem. And it's one worth repeating until it is corrected.

  25. thelaw
    Posted 15 years ago #

    You can argue all you want about the "www" issue but Wordpress MU is simply not www-friendly. Yes, I think it was a BRILLIANT idea to tell the world that you support non-www domains. A real revolutionary decision that will undoubtedly either change the world or tell people that Wordpress MU ain't worth the trouble.

    See my post here:

  26. lindows2008
    Posted 15 years ago #

    Hi Guys,

    I am very new to Wordpress MU, its my 3rd day playing with it and trying installing on few different Servers. One important thing I learned, BETTER NOT TRY INSTALLING ON SHARED HOSTING. I have bad experience with, they suck.

    Let me come to the issue now. While I was playing with MU configuration this is what I came up with to resolve the www issue.

    I guess I am using MU 2.6.x

    1. From MU Admin go to Site Admin > Blog
    2. Click "Edit" of the main domain (ID: "1", Domain: "")
    3. Replace all "" with ""
    4. Click "Update Options"
    5. If you do not get eny error then you are done (I doubt)

    a. Don't worry if you get an error and do the following.
    b. Go to mysql and run the following query

    "update wp_blogs set domain = '' where blog_id = 1;" without double quotes.

    Your "" is now ""

    You may face problem with some redirect URL. I will post update once if I can solve it.

    Hope it helps

  27. Vivek Shah
    Posted 15 years ago #

    can someone post detailed instruction for wp mu 2.7 ?

  28. thelaw
    Posted 15 years ago #

    Vivek, the instructions are above. I know how painful it is that hacks like these are necessary just to have a web site that begins "www" - who would ever think this would be the case?

    Lindows2008 - I have a few other tips.

    (1) Use phpmyadmin and do a search for and you'll see all the instances where you will need to manually add the "www"

    (2) You may also need to search for "" separately, just to make sure you've got everything added properly the first time. If you've got blogs already created, those won't have the http:// before the domain name.

  29. thornelawler
    Posted 15 years ago #

    My website is SSL-only in order to meet the privacy requirements of my users. My SSL certificate is not a wildcard certificate because of the mixed browser support for it. Hence, web traffic must come to, not the short version. Redirects to the short URL break the site. This was a deliberate design decision which predates wordpress by some years.

    In previous versions of WPMU I fixed this by grepping out the URL-mangling code in the two or three places it occurs and commenting it out. It now seems to have spread, and it is going to take me much longer to eradicate it from 2.7. I can't begin to describe how irritating it is to have to do this every time I upgrade.

    The authors' arbitrary, pointless religious beliefs do not belong in code, especially in a tool of such signifcance.

    I find it quite astonishing to find this level of unprofessionalism in what is otherwise a very mature, slick project. Grow up guys: This isn't Windows Vista; your users are old enough to make their own decisions.

  30. talk2manoj
    Posted 15 years ago #


    I have made some modification to wpmu-settings.php and index-install.php and it worked for me.

    A complete Step by Step instruction can be found at

    I have explained it by two methods.

    Please feel free to reply.

About this Topic

  • Started 18 years ago by ivanhoe
  • Latest reply from andrea_r