How to whitelist subdomain?
-
I’m setting up a Blog Network with WordPress Multisite using subdomains for blogs.
The main site is elevatesites.com which goes to the login page. Just how I want it!
However, I want to whitelist subdomains so that blogs under subdomains can still be viewed by the public.
For example, https://*.elevatesites.com/ should be able to be viewed without logging in, and all relevant pages and posts too.
Of course, the “*” should automatically be replaced with whatever subdomain blog is being viewed.
I don’t know PHP, but I’m sure you’ll understand what I mean by the code below.
/**
* Filter Force Login to allow exceptions for specific URLs.
*
* @return array An array of URLs. Must be absolute.
*/
function my_forcelogin_whitelist( $whitelist ) {
$whitelist[] = ‘https://*.elevatesites.com/’;
return $whitelist;
}
add_filter(‘v_forcelogin_whitelist’, ‘my_forcelogin_whitelist’, 10, 1);Can someone please give me advice on how to fix this?
Thank you
- The topic ‘How to whitelist subdomain?’ is closed to new replies.