Wordpress Multisite Question??

by 2 replies
3
If i have example.com and subdomain.example.com setup using multisite, would the user be able to register at any one of those, and have that registration used across both domains?

So if they login at example.com... they will also be logged into subdomain.example.com

Is that how it works?
#programming #multisite #question #wordpress
  • You need learn php+mysql.
  • In wp-config.php file, you need to add PHP to tell WordPress what the WP_HOME URL is

    Sample code

    switch ( $_SERVER['HTTP_HOST'] ) {
    case 'example1.domain.com':
    define( 'WP_HOME', 'http://example1.domain.com/' );
    break;
    case 'example2.domain.com':
    define( 'WP_HOME', 'http://example2.domain.com/' );
    break;
    default:
    define( 'WP_HOME', 'http://example.com/' );
    }

    define('WP_SITEURL', WP_HOME);

    You need to add the code in the top of wp-config.php before the MySQL settings. If you define('WP_HOME', $_SERVER['HTTP_HOST'])it will allow users to access your site under in any of the subdomain.

    Note: Backup your domain and database before modifying the Wp-config file

Next Topics on Trending Feed

  • 3

    If i have example.com and subdomain.example.com setup using multisite, would the user be able to register at any one of those, and have that registration used across both domains? So if they login at example.com... they will also be logged into subdomain.example.com