最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

multisite - turn single domain off

programmeradmin3浏览0评论

I am running WordPress 3.3.2 with multi site in subdomain mode.

I want to add a new subdomain but have it be "offline" until I finish working on it. Is there an easy way to do this?

I know that if its a single site I can just add an if in the header file and the site will be online only to me, but in this case all of my sites are using the theme, making it the same header file thus making this solution invalid.

I am running WordPress 3.3.2 with multi site in subdomain mode.

I want to add a new subdomain but have it be "offline" until I finish working on it. Is there an easy way to do this?

I know that if its a single site I can just add an if in the header file and the site will be online only to me, but in this case all of my sites are using the theme, making it the same header file thus making this solution invalid.

Share Improve this question edited Jul 5, 2019 at 18:52 the 1,5682 gold badges13 silver badges32 bronze badges asked Jul 7, 2012 at 23:18 Dvir LevyDvir Levy 1151 silver badge5 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 2

Your easiest route is probably to use a plugin like Restricted Site Access (disclaimer: written by my boss) to redirect a user who isn't logged in elsewhere, like the network home or something else. There are a few other similar plugins out there.

Another option would be to take the code you say you'd put in your theme and make your own little plugin with it instead. Then you can activate it for just that site. You'd need to be careful about which hook you use to check the user and then redirect.

Have you considered developing locally or on a development server and then transfering the theme/plugins/database over to your sub-site?

I would recommend it as it gives you a speed up in development time, you can test changes without worrying about affecting live users and you don't have to worry whether or not anyone can see your 'offline' site because it's literally on your own machine (or on your development server).

However, if that strategy is not viable for you or you simply don't wish to change your workflow - you could try a coming soon plugin which allows you as an admin to edit and view your site and shows a placeholder page to everyone else.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论