Choosing which pages require authentication on your site

Last modified: October 20th, 2023

Working with a specific static site generator?
Customize CloudCannon's documentation to suit your SSG.

Great! We'll show you documentation relevant to .
You can change this any time using the dropdown in the navigation bar.

Auth routes allow you to specify the routes you want to be authenticated and keep the rest public. By default, all routes are authenticated.

For example, you may want to hide a 'staff-only' section of your site behind password authentication.

To specify custom authenticated routes for your site:

  1. Create a file named auth-routes.txt in the root folder and ensure that this file is included on the built site. 
  2. Add the routes you want to this file, one on each line.

CloudCannon supports wildcards, allowing you to specify child folders or multiple files.

In the following example, visitors will have to log in to access /internal-news.html and anything inside /staff. Everything else is public.


Related Articles

Open in a new tab