I want to set up multiple WP installs in a few subdirectories. For example, one WP install would live at mydomain.com/blog. Another WP install might live at mydomain.com/project1 and another might live at mydomain.com/project2.
I’d like to enable single sign on so that I only have to issue one username and password for a user across these multiple WP installs. How might I accomplish this?
FYI…I’ve considered enabling MultiSite, but I decided against it for the following reason;
While permalinks will continue to work, the main blog (i.e. the first one created) will have an extra entry of blog, making your URLs appear like domain.com/blog/YYYY/MM/POSTNAME.
This is by design, in order to prevent collisions with SubFolder installs. Currently there is no easy way to change it, as doing so prevents WordPress from auto-detecting collisions between your main site and any subsites. This will be addressed, and customizable, in a future version of WordPress.
Thanks in advance for any assistance!
Eddie
1 Answer
Let your blogs share the same user table. In your blogs wp-config.php
files add:
define('CUSTOM_USER_TABLE', $table_prefix . 'my_users');
define('CUSTOM_USER_META_TABLE', $table_prefix . 'my_usermeta');
Important note from Codex:
Please note that permissions in the user_meta tables are stored with the table prefix of the site. So in the CUSTOM_USER_META_TABLE one must have entries for each site using that table. At the very least for the administrator, to avoid the “you do not have permissions error” you should have:
prefix1_capabilities = a:1:{s:13:"administrator";b:1;} and prefix2_capabilities = a:1:{s:13:"administrator";b:1;} etc