# URL Aliases

Site visitors like to access content from friendly and easy-to-remember URLs. Before we look at URLs in more detail, it’s important to understand GovCMS site structure. Your instructor will show you how GovCMS sites are assembled based on conditions you set.

When adding content to your site, GovCMS automatically assigns a URL alias\*. A URL alias uses the following format “/sanitised-item-title”. This may be useful for many generic purposes, but you could customise the paths.

{% hint style="info" %}
When a new content type is created, the URL pattern has to be configured in order to get the automatic URL aliases to generate.
{% endhint %}

The *Path* module adds a *URL ALIAS* fieldset to the content creation (and editing) form so that you can set up URL aliases for your pages. This provides two main advantages:

* Search engines give better rankings to user-friendly URLs so it’s a good SEO strategy.
* The URLs look better and are more intuitive for the user.

Refer to the following documentation for more information <https://www.drupal.org/docs/user_guide/en/content-paths.html>

## Let GovCMS handle URL aliases

Each new content item has a permanent URL that uses numbers, such as **node/1**. You’ll see this URL in the address bar when you click the Edit tab. This link does not change, even if you change the content's *Title*.

When you add content, you can create a custom URL alias and override the default settings.

![Image of Custom URL alias](/files/W57kjoqShvBh3UOzsPvg)

If you use the content's menu settings to add this to the Main menu, the link will be updated automatically:

![Image of Menu settings](/files/V9Ss8wAd2OznZ8I1Sja7)

![Image of Menu link to alias](/files/iyYlZQAMHiDBMdchoj8a)

## URL Patterns and the Pathauto Module

In GovCMS, we can include a specific URL pattern for our content pages, perhaps based on content type.

Examples:

* **Blog articles:** blog/\[node:title]
* **Events:** events/\[node:title]

![Image of Blog article Pattern settings](/files/FH8xgyWeZXk9RmfkOose)


---

# 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://salsa-digital.gitbook.io/govcms-site-builder/unit-7-url-aliases/url-aliases.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.
