> For the complete documentation index, see [llms.txt](https://docs-shpf.bsscommerce.com/bss-b2b-lock-login-password-hide-price/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-shpf.bsscommerce.com/bss-b2b-lock-login-password-hide-price/lock-core-concepts/goal-based-guides-i-want-to.../restrict-access-so-pages-can-only-be-viewed-via-secret-links.md).

# Restrict access so pages can only be viewed via secret links

**Goal**\
Make certain pages or collections accessible **only when someone uses a special secret link** (URL with a token).

**When to use this recipe**

* VIP early access pages.
* Hidden campaigns where you don’t want content in navigation or search.
* A soft “invite-only” experience without user accounts or tags.

***

#### Step 0 – Before you start

* Decide which page or collection you want to hide behind a secret link.
* Plan how you’ll distribute the secret URL (email campaign, manual share, etc.).

***

#### Step 1 – Lock content

1. Go to **Locks → Add lock**.
2. In **Step 1 – Lock content**:
   * Name: `Secret link for VIP sale`.
   * Target: appropriate content type:
     * For a collection → **Hide collection** but allow via secret link.
     * For a page → **Lock specific page/URL**.

***

#### Step 2 – Control access

1. In **Step 2 – Control access**:
   * Choose condition: **Secret link**.
2. The app will generate or expect a **special URL** that includes a secret parameter (token).
3. Only visitors arriving via that URL will pass the condition.

***

#### Step 3 – Advanced settings

* Message for people who land **without** the secret token:
  * “This page is not publicly available. If you received a special invitation, please use the link provided in your email.”
* Decide if you want to **redirect** those blocked visitors to your homepage or another safe page.

Click **Save**.

***

#### Check your page

* Visit the **normal URL** (without token) → should show your lock message or redirect.
* Visit the **secret link** (with token) → content should display normally.

Now you can send that secret link to your VIP audience.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs-shpf.bsscommerce.com/bss-b2b-lock-login-password-hide-price/lock-core-concepts/goal-based-guides-i-want-to.../restrict-access-so-pages-can-only-be-viewed-via-secret-links.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
