Clean URLs using Custom URLs

`fastn` allows your to map documents to any URL you like, let's take a look at why and how.

Problem

`fastn` by default creates the URL based on the file path of a document, eg `/` corresponds to `index.ftd` and `/docs/` looks for both `docs.ftd` and `docs/index.ftd`. This ties URLs with folder heirarchy.

SEO Angle

This can cause some issues with organisation, as SEO and clean URL people want URLs to not have meaningless information, like your folder heirarchy.

Short URLs

URLs are good, for example for `fastn.com`, we have a processor called [http processor](/http/) and we often want to link to it using `fastn.com/http/` which is short and easily memorisable. But the document we store is in `ftd-host/http.ftd` based on our organisations guidelines.

Folder Organization

But you do not want to put all the documents on the top level, as without folder heirarchy it becomes hard to navigate.

`document` attribute in `fastn.sitemap`

`fastn` is configured using a file called `FASTN.ftd`, where you can define a [sitemap of your site](/sitemap/). Normally your sitemap may look like this.
letting `fastn` guess the document based on `url`
-- fastn.sitemap:

- Home: /
- Docs: /docs/
Lang:
ftd
Auto guess can be overriden using the `document` attribute:
using `document` to specify document location
-- fastn.sitemap:

- Home: /
- Docs: /docs/
document: documentation.ftd
Lang:
ftd
There you go, make all your URLs clean, and folders organised! Do checkout the [dynamic URLs guide](/dynamic-urls/) to learn how to make URLs dynamic.

Support `fastn`!

Enjoying `fastn`? Please consider giving us a star ⭐️ on [GitHub](https://github.com/fastn-stack/fastn) to show your support!
[⭐️](https://github.com/fastn-stack/fastn)

Getting Help

Have a question or need help? Visit our [GitHub Q&A discussion](https://github.com/fastn-stack/fastn/discussions/categories/q-a) to get answers and subscribe to it to stay tuned. Join our [Discord](https://discord.gg/a7eBUeutWD) channel and share your thoughts, suggestion, question etc. Connect with our [community](/community/)!
[💻️](/community/)

Found an issue?

If you find some issue, please visit our [GitHub issues](https://github.com/fastn-stack/fastn/issues) to tell us about it.

Quick links:

- [Install `fastn`](install/) - [Create `fastn` package](create-fastn-package/) - [Expander Crash Course](expander/) - [Syntax Highlighting in Sublime Text](/sublime/)

Join us

We welcome you to join our [Discord](https://discord.gg/a7eBUeutWD) community today. We are trying to create the language for human beings and we do not believe it would be possible without your support. We would love to hear from you.
Copyright © 2023 - [FifthTry.com](https://www.fifthtry.com/)