Restricting Pages to Logged-In Visitors

Restricting Pages to Logged-In Visitors

With Scrivito, you can make pages available to just a part of your audience. For this, you can restrict the visibility of pages, meaning that they are no longer publicly accessible. Instead, only logged-in visitors are able to open such pages. This makes it possible to, for example:

  • Offer access to special content as an incentive to registering and logging in.
  • Require visitors to log in to be able use special services.

Next to being on a business plan, a prerequisite for letting visitors log in to a Scrivito-based website is having set up an identity provider in the CMS’s dashboard. This can be easily accomplished by an administrator. Also, the website application must have been prepared to enable visitors to log in. Scrivito supports authenticating via OpenID Connect, i.e. via an account at any provider offering this method, e.g. Microsoft or Google.

Setting the visibility of a page

In order to require a visitor to log in to access a specific page, open its properties, locate the “Visibility” switch, and set it as desired, e.g. to “Available to logged-in users”.

Binary content like images and PDF documents can be restricted via their properties view in the Content Browser.

Note that administrators can set up visibility categories as an addition to the “public” and “non-public” settings to restrict content to specific audiences like partners, suppliers, etc. These categories will then also be available for selection in the page properties.

As with all other settings, changes to the visibility of a page or a binary become effective only after the working copy has been published.

Moving or copying a restricted page to a website area consisting of unrestricted pages or vice versa causes Scrivito to ask you whether to adjust or keep the visibility setting of the page.

What it effects

After restricting a page and publishing the working copy, only logged-in visitors will be able to open this page. The restriction does not apply to editors logged into Scrivito’s editing interface.

Visitors not logged in can neither access a restricted page directly, i.e. by entering its URL in the browser’s address line, nor does the page show up on search result pages. Also, it won’t be present as an item in link lists and automatically generated navigations such as main menus. The page will simply appear to be nonexistent, even towards bots and crawlers. This also means that regular links pointing to a restricted page (e.g. from within a text widget) will cause a “Page not found” error to occur when clicked.

To determine whether links are pointing to a page you intend to restrict, check the “Linked by” tab in its properties view.