#  Issue with GetPage in Production: \_index.md Being Added to URLs

**URL:** https://discourse.gohugo.io/t/issue-with-getpage-in-production-index-md-being-added-to-urls/51274
**Category:** support
**Tags:** taxonomy
**Created:** [August 24, 2024, 2:18pm UTC](https://discourse.gohugo.io/t/issue-with-getpage-in-production-index-md-being-added-to-urls/51274 "2024-08-24T14:18:01Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![adeputr4](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/adeputr4/32/22762_2.png) [@adeputr4](https://discourse.gohugo.io/u/adeputr4)
#### Post date: [August 24, 2024, 2:18pm UTC](https://discourse.gohugo.io/t/issue-with-getpage-in-production-index-md-being-added-to-urls/51274/1 "2024-08-24T14:18:02Z")

</div>

Hi everyone,

I’m facing an issue with my Hugo site where a piece of code works perfectly in my local environment, but when I deploy it to production, it behaves differently.

The code in question is:

```auto
 $.Site.GetPage $content.url 

```

On my local environment, this code retrieves the correct page without any issues. However, in production, Hugo seems to be adding `_index.md` to the URLs, causing the page lookup to fail, and I’m unable to retrieve the desired page.

For example:

- **Local:** The URL resolves correctly, and the page is found.
- **Production:** The URL is somehow altered to include `_index.md`, and the page is not found.

Has anyone encountered this issue before? Is there a known fix or a way to ensure that `_index.md` is not included in the URL when calling `GetPage` in production?

Any help or guidance would be greatly appreciated!

Thanks!

---

<div class="post-metadata">

### Author: ![chrillek](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/chrillek/32/19797_2.png) [@chrillek](https://discourse.gohugo.io/u/chrillek)
#### Post date: [August 24, 2024, 2:25pm UTC](https://discourse.gohugo.io/t/issue-with-getpage-in-production-index-md-being-added-to-urls/51274/2 "2024-08-24T14:25:01Z")

</div>

One line of code ripped out of any context will probably not get you any useful response. No one knows what `$content` or `$content.url` might be.

Your best bet would be to post a link to your repository so that people can see the whole image.
