# Permalink does not return the correct page

**URL:** <https://discourse.gohugo.io/t/permalink-does-not-return-the-correct-page/42525>\
**Category:** support\
**Created:** [January 20, 2023, 9:09am UTC](https://discourse.gohugo.io/t/permalink-does-not-return-the-correct-page/42525 "2023-01-20T09:09:38Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [January 20, 2023, 4:59pm UTC](https://discourse.gohugo.io/t/permalink-does-not-return-the-correct-page/42525/6 "2023-01-20T16:59:36Z")

</div>

You are running into this:  
[https://github.com/gohugoio/hugo/issues/4507](https://github.com/gohugoio/hugo/issues/4507)

This is a detailed description of the situation:  
[https://discourse.gohugo.io/t/determine-if-current-page-is-result-of-pagination/37494/4](https://discourse.gohugo.io/t/determine-if-current-page-is-result-of-pagination/37494/4)

The trick is to paginate _before_ trying to access the _pager_ number.  
[https://discourse.gohugo.io/t/control-pagination-and-page-collections-from-baseof-html/37643/8](https://discourse.gohugo.io/t/control-pagination-and-page-collections-from-baseof-html/37643/8)

The second topic includes a detailed example that you can clone and test.

---

_[View the full topic](https://discourse.gohugo.io/t/permalink-does-not-return-the-correct-page/42525)._
