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

# Use Auto-Format Domains for Website URL Rules

> Reference for the Auto-Format Domains toggle, which scopes hostname rules in the Website URLs section of a GoGuardian Admin policy to an exact domain boundary.

Auto-Format Domains automatically adds a trailing slash (`/`) to the end of a rule in the Website URLs section of a GoGuardian Admin policy, allowing IT administrators to target top-level domains (TLDs), such as `*.edu`, while preventing users from accessing lookalike domains. Auto-Format Domains is enabled by default and applies only to rules you add going forward.

## Review How Auto-Format Domains Works

A website URL rule is made up of a scheme, a subdomain, a domain, a top-level domain (TLD), a path, and query parameters. GoGuardian removes the scheme and the `www` subdomain before matching a rule against a URL, and it applies a trailing slash when Auto-Format Domains is enabled.

Without a trailing slash, a rule matches any address that starts with it, including lookalike domains that only resemble the one you intended. `google.com` also matches `google.com.evil-site.net` because the rule has no boundary that marks where the intended domain ends.

| Rule Type | Rule                                   | URL                        | Result                  |
| --------- | -------------------------------------- | -------------------------- | ----------------------- |
| Allow     | `google.com/`                          | `google.com`               | Allowed                 |
| Allow     | `google.com/`                          | `google.com.evil-site.net` | Not allowed             |
| Allow     | `google.com` (Auto-Format Domains off) | `google.com.evil-site.net` | Allowed unintentionally |
| Block     | `google.com/`                          | `google.com`               | Blocked                 |

## Scope Rules to an Exact Top-Level Domain

To block or allow every website under a specific top-level domain, such as every `.edu` site, put a wildcard before the TLD. Auto-Format Domains adds the trailing slash for you, so `*.edu` becomes `*.edu/`.

| Rule     | URL                      | Result         |
| -------- | ------------------------ | -------------- |
| `*.edu/` | `schoolname.edu`         | Matches        |
| `*.edu/` | `learningisfun.edu/math` | Matches        |
| `*.edu/` | `google.com/.edu/page`   | Does not match |
| `*.tk/`  | `websitename.tk`         | Matches        |

Without the trailing slash, a rule like `*.co` also matches `.com` domains, because the match has no end boundary. Scoping the rule with a trailing slash is what limits it to the intended TLD.

## Know When Auto-Format Domains Does Not Apply

Auto-Format Domains only reformats a rule that names a host and nothing more specific. It leaves the following rule types unchanged, because they already target something more specific than a bare domain:

* **Rules with a path already**, such as `docs.google.com/document`.
* **Rules with a trailing wildcard**, such as `google.com*`.
* **Keyword and substring patterns**, such as `*proxy` or `*games*`, which search for text anywhere in a URL rather than matching a domain.

<Note>
  Auto-Format Domains applies only to rules entered directly in the Website URLs field. It does not reformat rules added through a CSV upload.
</Note>

## Turn Auto-Format Domains On or Off

Auto-Format Domains is on by default. To change it for a policy:

1. In [GoGuardian Admin](https://admin.goguardian.com/policy/assign/policies), navigate to **Policies**.
2. Click the name of the policy you want to update.
3. Open the **Website URLs** tab.
4. Turn **Auto-Format Domains** on or off, next to the **Website URL or Wildcard** field.

<Warning>
  With Auto-Format Domains off, a rule like `example.com` matches any address that starts with that text, including unrelated domains such as `example.com.evil-site.net`. Turn Auto-Format Domains back on, or add a trailing slash to the rule yourself, to limit it to the intended domain.
</Warning>

## Resources

<CardGroup cols={2}>
  <Card title="Use Wildcard Rules in Policies" href="/products/admin/filtering-with-wildcards">
    Reference for wildcard syntax elsewhere in a Website URL rule.
  </Card>

  <Card title="Allow and Block Websites" href="/products/admin/block-and-allow-websites">
    Add Website URL rules to a filtering policy.
  </Card>
</CardGroup>
