Point the subdomain to the same directory as the main site, and define different settings in your wp-config.php per $_SERVER['HTTP_HOST']
:
Example from my local setup:
switch ( $_SERVER['HTTP_HOST'] )
{
case 'zzl.dev':
$table_prefix = 'zzl_';
$table_name="zzl";
break;
case 'wpbuch.dev':
$table_prefix = 'wpbuch_';
$table_name="wpbuch";
break;
default:
$table_prefix = 'wp_';
$table_name="wpdev";
break;
}
$sub = '/wp-content/' . $_SERVER['HTTP_HOST'];
const WP_CONTENT_DIR = __DIR__ . $sub;
const WP_CONTENT_URL = 'http://' . $_SERVER['HTTP_HOST'] . $sub;
const DB_NAME = $table_name;
You can change much more variables in the switch: all DB_*
definitions, WP_PLUGIN_DIR
and WP_PLUGIN_URL
(to share the plugin list between different sites), WPLANG
and so on.
Related Posts:
- How to share WordPress core library
- Programmatically create blogs with dummy content on a WPMU site
- How to individually set WP_DEBUG on a sub-directory multisite?
- Create multiple subdomains for multi-site from a database
- How to map a specific multi-site blog to a folder?
- 4 single sites VS multisite wordpress
- multisite htaccess 301 redirects
- Two-level multisites in WordPress
- using 1 form shortcode (si or cf7) for all multisite sites [closed]
- How to manage multiple domain with different languages on each domain with single wordpress installation?
- Is there any fundamental difference in developing a wordpress multi-network site?
- merging two multisites
- Is there an advantage of using multisite if I have multiple WordPress websites for myself?
- Redirect loop (only for multisite network admin)
- favicon and multi site
- current_user_can(‘Administrator’) does not return true in multisite if user is Administrator but NOT Super Admin
- cant enable theme in multisite
- Deleting a user in multisite
- Recover from failed multisite conversion
- Proper Network Activation problem has been fixed in wp 3.3.1 or not?
- On WordPress Network(multisite), Sub Blogs in Subdirectories or Subdomains? What’s better?
- How to know if a site is using Multisite?
- Cookie nonce is invalid – Multisite
- Multisite setup on VVV with bedrock
- How can I delete a user from entire multisite nework
- Using A Shared/Common Theme Across Multiple Sites
- Activate Child Theme with Codex
- Multisite Network Localisation
- Can set_transient() be used in multi-site?
- Why does my multisite blog doesn’t show users?
- What would you recommend for hosting 10+ individual wordpress websites?
- ERR_TOO_MANY_REDIRECTS IN MULTISITE NETWORK DASHBOARD
- Redirect only posts to New Domain
- Image problem – Multisite image upload broken
- WordPress Multisite new sites in directory
- add_rewrite_rule on multisite doesn’t work
- web.config breaks the themes for sub-directory multisite
- Add a user to a specific blog when they register?
- How to configure Multisite Network with randomized hostnames?
- Different use for WordPress Multisite
- wp_insert_site() is triggering database error in a unit test
- Multisite: How to get a list of installed languages
- “You must be logged in to comment” but I am already logged in
- Multisite User Sync Question about blog authorship
- WordPress multisite .htaccess causes 500 error on old *.php URLs
- WP-CLI cron on multisite using WP-Toolkit “succeded”, but callback not executed
- WordPress multisite suddenly malfunctioning
- Site redirecting to http://example.com/wp-signup.php?new=example.com
- Cannot use pre_set_site_transient_update_themes from within a theme in multisite
- Login problems on multisite installation with different domains
- Multisite wordpress config on multidomain
- Is this a job for WP MultiSite with domain mapping plugin?
- Domain Mapping for WordPress MU and https redirection – How to?
- Move wp-content htacess
- FeedWordPress duplicated posts problem
- WordPress MU subdomain vhost
- Domain mapping with Multisite links are wrong
- Install multisite wordpress on a subdomain and map to top level domains
- Get latest blog post from another multisite blog
- How do I stop exactly one blog from network ever setting cookies?
- How to use different domains subdomains in WP multisite? [duplicate]
- Combining user database tables while keeping all other data in seperate for multiple sites?
- How to make multi site with single Database?
- Two Websites with the same administration Panel In WordPress
- Multi site installation with multiple domains ie(www.exampleone.com, www.exampletwo.com)
- Automatically Insert Into Post when uploading Media
- Hiding media uploaded by other users in wordpress multisite?
- Multitenant with a single site
- Configure WordPress Multisite Pages with Custom Permalinks
- WPMU function get_blog_details, last_updated/registered and formatting time and date string
- Multisite WordPress on a site that is more than 30 days old
- How to fix redirection of Post/Page of wordpress inside the wordpress?
- Multi Site Language switcher
- How to use the same “wp_posts” table for different subdirectories in the same DB?
- What is the proper way to merge 2 WordPress blog instances
- In Multisite – main site blog post should be display in minisite or subsite
- Multisite WordPress doesn’t work properly on virual hosts
- Displaying Multisite ID number
- Installing other applications alongside WordPress multisite subdomains
- Where does WordPress Mu DB store the link of network admin dashboard
- wordpress multisite – handle Database
- Importing Posts into New Website with Same User ID’s
- network admin pages not linked to correctly
- In Multisite: Site / Blog IDstill exists after deleting site
- Styles not being applied to multisite setup
- Use a single WP installation instead of three
- MU domain mapping without using a plugin
- Can WordPress Multisite work like a regular site?
- Multisite authorization error 401
- How create a multisite setup with “phantom” accounts and passwords?
- is there a if multisite have posts function?
- Multisite – mix sites that use subdomains with sites that use paths
- WordPress Multisite — Have same navigation, sidebar and footer across all sites.
- Primary site file uploads failing, subdirectory subsites upload fine
- Subdomain Wp-Admin Not Found
- Run “get_the_post_thumbnail” with a different table prefix?
- Pick your brain on wp-config.php if statement for multisite
- WordPress Multisite restict user access
- wordpress multisite with already existing subdomain
- Why the sites dropdown in multi-site installation is different from the list of sites when seen full page?