Skip to main content
improved the question
Source Link
Yuri
  • 1.1k
  • 4
  • 25
  • 46

I have a WP Multisite / Multi Network installation. What I need is to redirect all non-logged and also all logged in users, except logged in network administrators, from the main site example.com (including all nested pages, posts, categories etc.) to the subsite.example.com, that is a segregated multisite network. They share the same database. The network administrator will have access to the main site only after they will log in on the subsite.example.com. In this way, only the logged in network administrators must have access to the main site example.com.

UPDATE

The @seamus-leahy solution works, but only partially. I use his function in a multisite multi-networks installation and all networks in this configuration works like separated WP installations, so the network example.com will not recognize and log in automatically the network administrator when he/she is already logged in on the subsite.example.com (network 2), but logged out from the example.com (network 1). This means that the network administrator, in this context, also cannot access the main network example.com. How to solve this?

I have a WP Multisite / Multi Network installation. What I need is to redirect all non-logged and also all logged in users, except logged in network administrators, from the main site example.com (including all nested pages, posts, categories etc.) to the subsite.example.com, that is a segregated multisite network. They share the same database. The network administrator will have access to the main site only after they will log in on the subsite.example.com. In this way, only the logged in network administrators must have access to the main site example.com.

I have a WP Multisite / Multi Network installation. What I need is to redirect all non-logged and also all logged in users, except logged in network administrators, from the main site example.com (including all nested pages, posts, categories etc.) to the subsite.example.com, that is a segregated multisite network. They share the same database. The network administrator will have access to the main site only after they will log in on the subsite.example.com. In this way, only the logged in network administrators must have access to the main site example.com.

UPDATE

The @seamus-leahy solution works, but only partially. I use his function in a multisite multi-networks installation and all networks in this configuration works like separated WP installations, so the network example.com will not recognize and log in automatically the network administrator when he/she is already logged in on the subsite.example.com (network 2), but logged out from the example.com (network 1). This means that the network administrator, in this context, also cannot access the main network example.com. How to solve this?

Source Link
Yuri
  • 1.1k
  • 4
  • 25
  • 46

Redirect all users, except network administrators, from the main site to a subsite

I have a WP Multisite / Multi Network installation. What I need is to redirect all non-logged and also all logged in users, except logged in network administrators, from the main site example.com (including all nested pages, posts, categories etc.) to the subsite.example.com, that is a segregated multisite network. They share the same database. The network administrator will have access to the main site only after they will log in on the subsite.example.com. In this way, only the logged in network administrators must have access to the main site example.com.