| 1 |
--- |
| 2 |
title: Configure ugly URLs |
| 3 |
linkTitle: Ugly URLs |
| 4 |
description: Configure ugly URLs. |
| 5 |
categories: [] |
| 6 |
keywords: [] |
| 7 |
--- |
| 8 |
|
| 9 |
{{% glossary-term "ugly url" %}} For example: |
| 10 |
|
| 11 |
```text |
| 12 |
https://example.org/section/article.html |
| 13 |
``` |
| 14 |
|
| 15 |
In its default configuration, Hugo generates [pretty URLs](g). For example: |
| 16 |
|
| 17 |
```text |
| 18 |
https://example.org/section/article/ |
| 19 |
``` |
| 20 |
|
| 21 |
This is the default configuration: |
| 22 |
|
| 23 |
{{< code-toggle config=uglyURLs />}} |
| 24 |
|
| 25 |
To generate ugly URLs for the entire site: |
| 26 |
|
| 27 |
{{< code-toggle file=hugo >}} |
| 28 |
uglyURLs = true |
| 29 |
{{< /code-toggle >}} |
| 30 |
|
| 31 |
To generate ugly URLs for specific sections of your site: |
| 32 |
|
| 33 |
{{< code-toggle file=hugo >}} |
| 34 |
[uglyURLs] |
| 35 |
books = true |
| 36 |
films = false |
| 37 |
{{< /code-toggle >}} |