MultiBlog
it occurs to me that having the database encapsulated in a single file leads to making multiple blogs available on a single installation of wordpress remarkably easy.
i’d want to use something like $_SESSION['SERVER_NAME'] or equivalent to determine the name of the blog that has been requested, and point the database engine at the right file based on that info.
of course we’d need to a bit a bit wary of the url rewriting that goes on but that should not be a killer, really. and hopefully it could all be done within the PDO For WordPress code base or wp-config.php rather than as a patch file.
any thoughts anyone?
I think this would be a great idea. I would think that this could potentially be done as a modified set of mod_rewrite rules.
Since wordpress currently uses a hard-coded site url we would also need to somehow change the site url on the fly. This information may be stored in the database anyways so if we detect the url in advance then simply changing the database location (as you have suggested) should be sufficient. I havn’t checked the technical side of it. All I know is when I went to access the blog via 192.168.1.1:8080 it re-routes to router.blah.org:8080 once the blog starts to load.
I did check the available php variables and $_SERVER["SERVER_NAME"] should be safe. I checked it on my lighttpd and apache installs and they both reported my server name (complete with port number if not on port 80). Don’t use the $_ENV sets because they were missing on my apache install. Both use fastcgi.