I suppose www.mainsite.com
is the main blog and www.mainsite.com/subtitle
is a dynamic child blog. You can use MU api for this:
add_action("init", function(){
global $pagenow;
if ( 'wp-login.php' !== $pagenow ) return;
global $blog_id;
$main_blog_ID = 1; // main site ID (use get_current_blog_id() to get ID)
if ( (int) $blog_id !== (int) $main_blog_ID ) {
switch_to_blog( $main_blog_ID );
wp_redirect( wp_login_url() );
exit;
}
});
Hope that helps.
Related Posts:
- How to use WordPress Multisite With Different Domain Names?
- Can i merge 2 new WP_Query($variable) ‘s?
- How to reliably flush rewrite rules on multisite?
- Using wp_insert_post() with Networking enabled
- Sharing Dynamic Sidebars across Multisite Blogs
- multisite: use a virtual subfolder for subblogs
- WP Multisite – multilanguage – swich to other language by click, but “same” content
- How To Provide Sub-Blogs Their Own Domain Names?
- “You need a higher level of permission” after admin changing. Why?
- Advanced Custom Fields Multisite Upload/Imagery Issue [closed]
- Prevent user creating new users with specific roles
- What is the correct form action URL for network options pages?
- Lock one of WP Network sites for not registered users
- How can I manage all multisite pending comments in one place?
- WordPress Multisite Network installation and dev questions
- BuddyPress on Multisite [closed]
- List all sites in multisite
- Migrating WPMS from apache to IIS7 causes Database Error
- Turn off trackback/pingbacks and comments on all existing multisite sites
- Subfolder multisite issue. Themes and plugin files 404
- Creating Admin Options Page where users can make changes to a theme
- htmll lang=”de” but admin page in English
- Multisite list all pages in site
- WordPress Multisite Sites show in Dropdown but not in Sites menu
- Dissolve Multisite while making site #5 the main site?
- Disable domain redirect
- Multisite setup on IIS with subdomains
- Partially translated dashboard in one of network’s site
- How can I fix a Virtual Multiblog install that has no errors, but won’t show all my sites?
- Disabling outbound connectivity on web servers [closed]
- Depth > 2 possible with multisite?
- What are Attributes used for in a WordPress Multisite?
- Make a user administrator to a sub directory site and a contributor to main site in multisite network
- How to store custom user data on the database?
- NGINX rewrite rules for sub subdomains
- Enable wildcard in a WordPress Multisite (Sub-Domains)
- Temp URL Redirect Loop
- wordpress multisite dashboard link in admin bar
- Multisite – user email activation links broken
- Multisite with subfolders- can’t access main site- Error establishing a database connection
- WP MU Register User across all blogs
- multisite subdomain behind reverse proxy
- Set default settings for all new multisites?
- How to disable a network enabled plugin on all sites, excepting on one?
- Multisite Subdirectory with same domain subdomain
- wp_mail() not sending email in multisite subdomain
- What are good approaches to routing some urls to a second WordPress install?
- Show media-frame-menu on custom Media Frame
- Show content of other domain inside WordPress
- Moving a remote WordPress multisite installation to local
- Multisite redirecting wrong when without WWW
- Multisite, domain mapping and SSL?
- Google Apps SMTP for WP MultiSite?
- Get users registered 30 days ago(or more)
- Pull Custom /wp-admin/css for Non-Admin in Multisite
- Being Forced To Use Sub-Domains on Multisite
- WordPress in subdirectory, Multisite using subdomains Nginx
- WordPress Multisite with subdomains on different domains
- Is WordPress cache shared for all blogs in a multisite network?
- Display Selected themes to user in admin for wordpress multisite
- White blank page when Updating/Draft/Publishing Page/Post
- The Events Calendar: Events page as Home page [closed]
- Multisite wp-admin goes to blank screen after forwarding URL
- blog change and move to anther hosting for a multisite
- How to unindex a single blog in Multisite?
- How to redirect user after session timeout
- WPMU If MU site has no administrator, deactivate site
- Questions about MU database schema and how to list all blogs
- Choosing the right kind of hosting for a WordPress multisite
- Moving wordpress multi to different domain and vhost – cannot log in and menu problems
- Insert post into subsite using code
- Multisite ad server solution
- How can I run multiple unique WordPress sites off of one VPS
- Function to Load Admin CSS for Super Admin on Multisite
- Multisite Configurations
- How to update wordpress content of wordpress multi-site subdomain
- How to post same content on multisite?
- Created child theme from Themegrill Flash-Pro and the child theme is blank
- Configure redirects with web.config
- Events Calendar Multisite 404 for events
- WordPress Database Cleanup
- Multi site migration error for wildcard domains
- Multiple Languages for each subsite on a Multisite
- Optimal setup for Multi Domain WordPress with Woocommerce
- what if one user in WPMU change the theme files?
- Multisite /files/ URLs broken after server move
- WordPressMU: URL change and broken permalinks/links
- Extended URLs created using multisite feature not loading CSS/JS
- White pages on sub domains after server transfer
- No input file specified after enabling multi site
- How do I enable Multisite on WP 3.7.1?
- Multiple domains for with a single instal
- Using common slider in all sites
- Letting clients use visual builders plugins/themes on WordPress Multisite installation
- Registration Page
- WordPressMu network with private sites
- WordPress Multisite (Network) some site users added to main site users list as subscriber
- Moving a WordPress Multisite site to a new install
- Multisite admin panel not working after the update
- WordPress Network / Multisite login to one site allow access to all