Is there a way to disable non-primary sites on a multisite setup so that users are redirected to a 503 template?

I can't see any configurations that allow me to to this. All sites are either disabled or live.


Seems like this is something you'd do from your .htaccess file or public index.php files for each of the non-primary sites you define.

For example if you have a public_html/index.php for your English primary site and a public_html/de/index.php for your German site, your German one would just header("Location: http://mysite.com/503"); to redirect.

| improve this answer | |
  • 2
    That might work for some cases, but I think it's not a user-friendly way to disable a site. For example, I am working on a website that has various countries sites in a different language, and I want to create extra countries and add data to these countries. But I do not want these to be available in the frontend yet. Wouldn't be simpler if I could have a lightswitch that would disable it? – bzin May 7 '18 at 10:00
  • Did you find a way bzin? Agree, it needs a simple way to disable for non-logged in users, but logged in admins can see it, whilst its in development. The only way I can think of is in the layout file at the top, check if user is an admin, and if they are not redirect to a 404. If they are, they will see the site as normal. – Laurence Cope Mar 5 '19 at 16:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.