# How do I write this redirect with a #?

**URL:** <https://forum.ghost.org/t/how-do-i-write-this-redirect-with-a/48233>\
**Category:** Using Ghost\
**Created:** [June 18, 2024, 10:09pm UTC](https://forum.ghost.org/t/how-do-i-write-this-redirect-with-a/48233 "2024-06-18T22:09:31Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Benjamin\_Chia](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/benjamin_chia/32/30887_2.png) [@Benjamin\_Chia](https://forum.ghost.org/u/Benjamin_Chia)\
**Post date:** [June 18, 2024, 10:09pm UTC](https://forum.ghost.org/t/how-do-i-write-this-redirect-with-a/48233/1 "2024-06-18T22:09:31Z")

</div>

I’m trying to redirect from a tag to a custom directory page:

/#industry-insights/ to /industry-insights/

In the redirects.yaml page, I tried the following but it’s not working

`/#industry-insights/: ^/industry-insights/$`

How can I get this to work?

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [June 18, 2024, 10:18pm UTC](https://forum.ghost.org/t/how-do-i-write-this-redirect-with-a/48233/2 "2024-06-18T22:18:35Z")

</div>

Browsers don’t send the hash when making a request -

`https://example.com/about#our-team` would be requested as `https://example.com/about`.

> [@Benjamin\_Chia](#):
>
> /#industry-insights/ to /industry-insights/

Can you clarify this statement? Internal tags (tags that start with `#`) do not have a tag page.

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [June 18, 2024, 10:37pm UTC](https://forum.ghost.org/t/how-do-i-write-this-redirect-with-a/48233/4 "2024-06-18T22:37:41Z")

</div>

Is this question about Ghost? Because it’s not possible to access a tag page with a # in it.

---

<div class="post-metadata">

**Author:** ![Benjamin\_Chia](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/benjamin_chia/32/30887_2.png) [@Benjamin\_Chia](https://forum.ghost.org/u/Benjamin_Chia)\
**Post date:** [June 18, 2024, 11:00pm UTC](https://forum.ghost.org/t/how-do-i-write-this-redirect-with-a/48233/5 "2024-06-18T23:00:39Z")

</div>

Yeah it’s about Ghost. Using this theme, open to any solution to redirect a tag name that shows up as a filter.

> **[Rinne Theme Documentation](https://brightthemes.com/docs/rinne#resources)**
>
> Learn about Rinne theme features, configuration and customization by accessing the comprehensive and user-friendly documentation.

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [June 18, 2024, 11:02pm UTC](https://forum.ghost.org/t/how-do-i-write-this-redirect-with-a/48233/6 "2024-06-18T23:02:52Z")

</div>

Paging @brightthemes !

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [June 18, 2024, 11:05pm UTC](https://forum.ghost.org/t/how-do-i-write-this-redirect-with-a/48233/7 "2024-06-18T23:05:17Z")

</div>

So what’s going on there is that there’s just one page, at /. And then there’s some javascript reading the #tagname and filtering what posts show up. If you can edit the theme files, it’ll be an easy change to make. Skip the javascript and just link directly to /tag/whatevertagname .

---

<div class="post-metadata">

**Author:** ![brightthemes](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/brightthemes/32/42205_2.png) [@brightthemes](https://forum.ghost.org/u/brightthemes)\
**Post date:** [June 19, 2024, 4:43am UTC](https://forum.ghost.org/t/how-do-i-write-this-redirect-with-a/48233/8 "2024-06-19T04:43:09Z")

</div>

Yes, @Cathy_Sarisky is right, the links are all pointing to the homepage with a different hash, so redirect is not the solution. As was suggested you can edit the theme files to replace `#{{slug}}` with `/tag/{{slug}}`.

Alternatively you can add the following in your code injection \> site footer:

```html
<script>document.querySelectorAll('.resources-filter a')?.forEach(filter => filter.setAttribute('href', filter.getAttribute('href').replace('#', '/tag/')))</script>

```

If you need further help you can contact me here: [Contact | Bright Themes](https://brightthemes.com/contact)

---

<div class="post-metadata">

**Author:** ![Benjamin\_Chia](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/benjamin_chia/32/30887_2.png) [@Benjamin\_Chia](https://forum.ghost.org/u/Benjamin_Chia)\
**Post date:** [June 19, 2024, 5:23pm UTC](https://forum.ghost.org/t/how-do-i-write-this-redirect-with-a/48233/9 "2024-06-19T17:23:54Z")

</div>

Got it! The code injection worked great to get /tag/{{slug}}. I’m now trying to redirect from: `/tag/industry-insights to /industry-insights/`

This is what I have in the redirects.yaml: `/tag/industry-insights/: ^/industry-insights/$` but it’s not redirecting correctly.

Any thoughts here? It’ll just go to the original tag page and say 404.

EDIT: got it to work! Linked directly to the web URL instead.

---

<div class="post-metadata">

**Author:** ![brightthemes](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/brightthemes/32/42205_2.png) [@brightthemes](https://forum.ghost.org/u/brightthemes)\
**Post date:** [June 19, 2024, 8:12pm UTC](https://forum.ghost.org/t/how-do-i-write-this-redirect-with-a/48233/10 "2024-06-19T20:12:24Z")

</div>

You shouldn’t use redirects for that, that is defined in the routes.yaml file.  
More details here:

> **[Change the URL for tags and authors](https://ghost.org/tutorials/change-taxonomy-url/)**
>
> Transform tags into topics, authors into contributors, or any into any other terms by updating your site's taxonomy.

---

<div class="post-metadata">

**Author:** ![Benjamin\_Chia](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/benjamin_chia/32/30887_2.png) [@Benjamin\_Chia](https://forum.ghost.org/u/Benjamin_Chia)\
**Post date:** [June 27, 2024, 7:37pm UTC](https://forum.ghost.org/t/how-do-i-write-this-redirect-with-a/48233/11 "2024-06-27T19:37:30Z")

</div>

Hm interesting, took a look through the documentation but still a bit confused… How would I write it in the routes.yaml?

---

<div class="post-metadata">

**Author:** ![brightthemes](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/brightthemes/32/42205_2.png) [@brightthemes](https://forum.ghost.org/u/brightthemes)\
**Post date:** [June 28, 2024, 7:34am UTC](https://forum.ghost.org/t/how-do-i-write-this-redirect-with-a/48233/12 "2024-06-28T07:34:12Z")

</div>

By changing the taxonomies permalink, you can remove the hardcoded prefix `tag` and leave the `{slug}` only or add your own prefix.
