1

I am trying to create maintenance mode page to be able to close only a part of site using URL mask: //example.com/private-cabinet/ So all pages /private-cabinet/etc/etc/etc needs to be down for maintenance with 503 HTTP status, but at the same time //example.com/ or //example.com/any-other-url/ needs to be available. Also would be great if admin user is able to bypass this redirect and see the content.

Can you help me with some custom code or maybe there actually is a plugin that meets my needs? Because all plugins I have found seems to be able to close only entire site, not just part of it.

Joshua
  • 40,822
  • 8
  • 72
  • 132
Ted
  • 55
  • 1
  • 10

2 Answers2

1

Place the following code in your .htaccess file when the time you want to restrict users to access that particular folder.. after that remove the code from .htaccess file.

<Directory  ~ "\private-cabinet\etc\etc\etc">
Order allow,deny
Deny from all
</Directory>
ErrorDocument 403 http://www.example.com
Ratna Raju
  • 37
  • 12
  • I must be not explain myself clearly, \private-cabinet\etc\etc\etc it is not a folder, it is URL mask. So I need an entire site "example.com/and-any-other-url" to be available, except URLs, which contains "/private-cabinet/and-any-other-url" after "example.com" – Ted Feb 23 '17 at 08:31
  • try this...https://www.siteground.com/kb/url_masking_with_htaccess/ @Ted – Ratna Raju Feb 23 '17 at 09:41
1

After few hours I have found a plugin that allows what I need. It is not ideal and lacking of more customisation options, but it can be easilly enough extended with editing of plugin .php page template.

Ted
  • 55
  • 1
  • 10