> ## Documentation Index
> Fetch the complete documentation index at: https://usegately.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Gated Content

> Restrict access to pages, files, and links based on membership plans or authentication

Gated Content lets you protect specific pages, files, or links so only the right people can access them. You can restrict access by plan, require authentication, or limit to specific email addresses.

## How It Works

You define rules that tell Gately which URLs to protect and who can access them. When someone tries to visit a protected URL, Gately checks if they meet the requirements — and redirects them if they don't.

***

## Creating a Gated Content Rule

<Steps>
  <Step title="Go to Gated Content">
    In your sidebar, under **Authentication**, click **Gated Content**.
  </Step>

  <Step title="Click Add Content">
    Click **Add Content** in the top right.
  </Step>

  <Step title="Set the URL pattern">
    Enter the URL or path you want to protect. Choose a matching rule — contains, exact, starts with, ends with, or regex.
  </Step>

  <Step title="Choose an access type">
    Select who can access this content — by plan, by authentication, both, or admin only.
  </Step>

  <Step title="Set the redirect URL">
    Enter the URL to send users to if they don't have access — usually your login or upgrade page.
  </Step>

  <Step title="Save">
    Click **Save**. The rule is now active.
  </Step>
</Steps>

***

## Access Types

| Type                        | Who can access                        |
| --------------------------- | ------------------------------------- |
| **Plan Required**           | Members on one or more specific plans |
| **Authentication Required** | Any logged-in member                  |
| **Both**                    | Logged-in members on a specific plan  |
| **Admin Only**              | Specific email addresses you define   |

***

## URL Matching

| Rule            | Example          | Matches                           |
| --------------- | ---------------- | --------------------------------- |
| **Contains**    | `/members`       | Any URL with `/members` in it     |
| **Exact**       | `/dashboard`     | Only `/dashboard` exactly         |
| **Starts With** | `/premium/`      | Any URL starting with `/premium/` |
| **Ends With**   | `/pro`           | Any URL ending with `/pro`        |
| **Regex**       | `/course/[0-9]+` | Pattern-based matching            |

***

## Admin Only Access

The **Admin Only** access type lets you restrict content to a specific list of email addresses — useful for internal pages, beta features, or team-only content.

<Steps>
  <Step title="Choose Admin Only">
    Set the access type to **Admin Only**.
  </Step>

  <Step title="Add email addresses">
    Type an email address and press Enter or click Add. Repeat for each person.
  </Step>

  <Step title="Save">
    Only those exact email addresses will be able to access the content.
  </Step>
</Steps>

***

## Tips

<AccordionGroup>
  <Accordion title="Protect a whole section">
    Use **Starts With** to protect an entire section of your site at once — for example, `/members/` covers all pages under that path.
  </Accordion>

  <Accordion title="Combine with Redirect Rules">
    Set up a **Redirect Rule** for **Access Denied** to send users to a helpful upgrade or login page instead of a blank error.
  </Accordion>

  <Accordion title="Test your rules">
    After saving a rule, open the URL in an incognito window to verify the redirect works as expected.
  </Accordion>
</AccordionGroup>
