# Setting up netlify.toml for pretty url

**URL:** <https://answers.netlify.com/t/setting-up-netlify-toml-for-pretty-url/84198>\
**Category:** Support\
**Tags:** settings-config, redirects\
**Created:** [January 29, 2023, 4:29am UTC](https://answers.netlify.com/t/setting-up-netlify-toml-for-pretty-url/84198 "2023-01-29T04:29:24Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![nathanmartin](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/nathanmartin/32/30845_2.png) [@nathanmartin](https://answers.netlify.com/u/nathanmartin)\
**Post date:** [February 7, 2023, 9:33pm UTC](https://answers.netlify.com/t/setting-up-netlify-toml-for-pretty-url/84198/8 "2023-02-07T21:33:39Z")

</div>

I believe part of the confusion here is whether or not the ‘Asset optimization - Pretty URLs’ is supposed to apply any redirection of a users request for a file.

My understanding, based on the description written under it, is that it scans and changes your HTML to remove references to URLs ending in `.html`, so if you had a link of `href="/about.html"`, it would adjust your code to `href="/about"`.

What @luisrieke is questioning is that if a user is directly accessing a file with the `.html` extension in the URL, a file which does exist, is it possible to redirect them to the Pretty URL for that same file.

Example: Going directly to [https://luisrieke.com/running.html](https://luisrieke.com/running.html) loads `/running.html` and doesn’t redirect to `/running`

I’m not sure I’ve ever tried, but I imagine due to [shadowing](https://docs.netlify.com/routing/redirects/rewrites-proxies/#shadowing) any redirect for it would need to include `force`.

So perhaps the equivalent of:

```auto
[[redirects]]
  from = "/running.html"
  to = "/running"
  force = true

```

---

_[View the full topic](https://answers.netlify.com/t/setting-up-netlify-toml-for-pretty-url/84198)._
