# Customize the URL Path structure

**URL:** <https://forum.gitea.com/t/customize-the-url-path-structure/7214>\
**Category:** Install/Maintain/Configure\
**Created:** [May 6, 2023, 12:49am UTC](https://forum.gitea.com/t/customize-the-url-path-structure/7214 "2023-05-06T00:49:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MinTea](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@MinTea](https://forum.gitea.com/u/MinTea)\
**Post date:** [May 6, 2023, 12:49am UTC](https://forum.gitea.com/t/customize-the-url-path-structure/7214/1 "2023-05-06T00:49:36Z")

</div>

How to customize the URL path structure?

## Some changes I’d like to make:

- Remove the word `branch` from the URL. Such as in the current path structure:

`https://gitea.example.com/<user>/<repository>/raw/branch/<branch_name>/README.md`

I could not find anything in the documentation mentioning it.

- Move the word `raw` to be a subdomain, and become something like:

`https://raw.gitea.example.com/<user>/<repository>/<branch_name>/README.md`

I know this is possible via a proxy, but I’m wondering if I can do it directly on Gitea.

---

<div class="post-metadata">

**Author:** ![lunny](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/lunny/32/4701_2.png) [@lunny](https://forum.gitea.com/u/lunny)\
**Post date:** [May 6, 2023, 4:06am UTC](https://forum.gitea.com/t/customize-the-url-path-structure/7214/2 "2023-05-06T04:06:28Z")

</div>

Sometimes, a tag can have the same name with a branch. That’s why we have a prefix before branch\_name.

For the second, it really belongs to a reverse proxy reponsibility.

---

<div class="post-metadata">

**Author:** ![jake](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@jake](https://forum.gitea.com/u/jake)\
**Post date:** [May 6, 2023, 9:29pm UTC](https://forum.gitea.com/t/customize-the-url-path-structure/7214/3 "2023-05-06T21:29:18Z")

</div>

If you are very intent on doing this without reverse proxy, you could modify Gitea and compile your own binary.

1. You can change routes in this file [gitea/web.go at main · go-gitea/gitea · GitHub](https://github.com/go-gitea/gitea/blob/main/routers/web/web.go#L950). You will have to make the relevant modifications to templates as well. Note that this change is probably not ideal like lunny mentioned.

2. The raw link can be amended in the template, or modify the raw route to redirect to the raw domain in the code. Most maintainable would be to change the template, since you can provide official Gitea binary with custom templates.
