# URL Shortener

<figure><img src="/files/d8umAX9uQgRDllO9E3uT" alt=""><figcaption><p>Sonoran CMS - URL Shortener</p></figcaption></figure>

{% hint style="danger" %}
**The URL Shortener is only enabled with a Pro Subscription!**

Learn more about our [paid plans](/cms/pricing/pricing-faq/create-and-manage-a-subscription.md).
{% endhint %}

## What are Short URLs?

Create friendly, short URLs for anything in your community!

The URL shortener takes any link and converts it to a short and readable format!\
Ex: `https://discord.com/invite/123456` -> `mycommunity.com/discord`

## Creating a Short URL

### New Short URL

To forward `https://discord.com/invite/123456` to our [custom domain](/cms/tutorials/customization/custom-domain.md#custom-domain)'s `mycommunity.com/discord`

1. Enter the existing URL `https://discord.com/invite/123456`
2. Enter the new short URL path `discord`
3. (Optional) add a description `Discord invite link`

<figure><img src="/files/88TwEHq2E26bdq2LAJkQ" alt=""><figcaption></figcaption></figure>

After adding the new short URL, it will be viewable, searchable, and copyable in the table below.

<figure><img src="/files/u5RJkNN65uqzXCVDMLLo" alt=""><figcaption></figcaption></figure>

### Domain Formats

The CMS supports three types of short URL formats:

* [Custom Domain](/cms/tutorials/customization/custom-domain.md#custom-domain): `customdomain.com/shorturl`
* [Custom Subdomain](#custom-subdomains): `example.customdomain.com/shorturl`
* [Vanity Domain](/cms/tutorials/customization/custom-domain.md#vanity-urls): `communityid.sonorancms.com/shorturl`
* Long Domain: `sonorancms.com/com/communityuuid/shorturl`

The custom path will work on all three of these options. The toggle simply allows you to select which format you are copying.

## Custom Subdomains

Subdomains are extensions of your custom domain and are used to organize or separate different sections of a website (e.g., info.customdomain.com).

### Adding A Subdomain

<details>

<summary>1. Click to Add a New Subdomain</summary>

Click the `+` icon next to the short URL type selector.

<img src="/files/fWyIqDoqd94bN58eCBmG" alt="URL Shortener: Add Subdomain" data-size="original">

</details>

<details>

<summary>2. Enter the Desired Subdomain</summary>

Enter your desired subdomain for your community's [configured custom domain](/cms/tutorials/customization/custom-domain.md#custom-domain).

Here, the subdomain is `links` and the custom domain is `sonoranrp.com`

<img src="/files/8NP3PuKbxeIp5y65QOGT" alt="URL Shortener: Subdomain Url" data-size="original">

</details>

<details>

<summary>3. Copy and Add DNS Records</summary>

Copy the information from the panel to create a `CNAME` and `TXT` DNS record.

<img src="/files/XmCv62m2ZjdAjY8bK9yo" alt="" data-size="original">

The examples below show DNS management via Cloudflare.\
If you are unsure how to add a DNS record, contact your domain provider.

\
If you are using Cloudflare, **DISABLE the proxy mode** and set it to `DNS Only`

![Cloudflare: Subdomain CNAME Record](/files/f2BzqGKI4ObFwAw6yN2y) ![Cloudflare: Subdomain TXT Record](/files/WdoWKr5ck3aiVMcRFEEq)

</details>

<details>

<summary>4. Save and Use Subdomain</summary>

After saving your new `CNAME` and `TXT` record, click `Add Link Subdomain` to verify the DNS records.

Note: *Depending on your DNS provider, there may be a cache delay before the DNS records are detected.*

<img src="/files/lELXuPMPNeRBAbX4nmgR" alt="" data-size="original">

You can now select the custom domain in the `URL Type` drop-down to be used when creating a new short URL.

</details>

## Reserved Paths

Sonoran CMS has several internal URL paths that can not be overridden by a custom short URL.

Sonoran CMS will also not allow you to override an existing [website slug](/cms/tutorials/community-website/website-builder.md) with a custom short URL.

```
admin
index
login
logout
signup
gallery
menu
event
account
oauth/discord
oauth/sonoran
oauth/apple
drive/file
game/menu
game/qbcore
profile
roster
forums
forums/topics
calendar
forms
```

These paths are restricted only in their absolute form. Appending additional paths to these are allowed. For example:

A short URL can **NOT** be: `example.com/forms`

However, a short URL **CAN** be: `example.com/forms/civ`


---

# Agent Instructions: 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:

```
GET https://docs.sonoransoftware.com/cms/tutorials/administrative/url-shortener.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
