# // in next page link messes up S3

**URL:** <https://discourse.gohugo.io/t/in-next-page-link-messes-up-s3/4578>\
**Category:** support\
**Created:** [November 15, 2016, 9:03pm UTC](https://discourse.gohugo.io/t/in-next-page-link-messes-up-s3/4578 "2016-11-15T21:03:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrickn](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/patrickn/32/2256_2.png) [@patrickn](https://discourse.gohugo.io/u/patrickn)\
**Post date:** [November 15, 2016, 9:03pm UTC](https://discourse.gohugo.io/t/in-next-page-link-messes-up-s3/4578/1 "2016-11-15T21:03:26Z")

</div>

Hi Everyone,

New to Hugo but great experience so far.

I am having a problem with pagination, front page generates fine. But after the first 10 posts the next link at the bottom of the page generates a uri with a double slash ‘//’. The site is hosted on Amazon S3 which gets screwed up by this so I get a 404. Manually deleting the extra / allows the page to load.

You can see what I mean at [http://neavey.net](http://neavey.net), scroll to the bottom and click Next.

I am using the Icarus theme if that makes any difference.

Thanks

P.

---

<div class="post-metadata">

**Author:** ![rdwatters](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rdwatters/32/2848_2.png) [@rdwatters](https://discourse.gohugo.io/u/rdwatters)\
**Post date:** [November 15, 2016, 9:18pm UTC](https://discourse.gohugo.io/t/in-next-page-link-messes-up-s3/4578/2 "2016-11-15T21:18:09Z")

</div>

Out of curiosity, do you have your `baseurl` set to `http://neavey.net` or `http://neavey.net/`. If the latter, have you tried removing the final slash?

---

<div class="post-metadata">

**Author:** ![patrickn](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/patrickn/32/2256_2.png) [@patrickn](https://discourse.gohugo.io/u/patrickn)\
**Post date:** [November 15, 2016, 9:22pm UTC](https://discourse.gohugo.io/t/in-next-page-link-messes-up-s3/4578/3 "2016-11-15T21:22:16Z")

</div>

It is set with trailing slash. I did remove it but it causes other problems with various css files not being found. They were being looked for at uri’s such as neavey.netcss/styles.css.

I am still not sure whether the correct way is to add the trailing slash or not, seems some themes require it some don’t

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [November 15, 2016, 9:36pm UTC](https://discourse.gohugo.io/t/in-next-page-link-messes-up-s3/4578/4 "2016-11-15T21:36:35Z")

</div>

Anyhow it must be fixed in the theme, so you should raise an issue at that theme’s issue tracker.

Theme authors should use the `absURL` and its relatives for all URL string creation, that should resolve most issues like this.

---

<div class="post-metadata">

**Author:** ![patrickn](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/patrickn/32/2256_2.png) [@patrickn](https://discourse.gohugo.io/u/patrickn)\
**Post date:** [November 15, 2016, 10:25pm UTC](https://discourse.gohugo.io/t/in-next-page-link-messes-up-s3/4578/5 "2016-11-15T22:25:23Z")

</div>

Ok, I’ll do that. Thanks for your help.

---

<div class="post-metadata">

**Author:** ![coquille](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/coquille/32/5264_2.png) [@coquille](https://discourse.gohugo.io/u/coquille)\
**Post date:** [February 15, 2018, 12:43pm UTC](https://discourse.gohugo.io/t/in-next-page-link-messes-up-s3/4578/6 "2018-02-15T12:43:37Z")

</div>

I had the same problem except I couldn’t use your solution because when I put asbURL I would get an error message. If others have the same problem, here is how I fixed the problem on my site, hoping it doesn’t have secondary effets.

1. In config.toml you add: absurl = “[http://www.indalit.com](http://www.indalit.com)”
2. In list.html you change:

```auto
{{ if .Paginator.HasPrev }}
<li class="previous"><a href="{{ .Site.BaseURL }}{{ .Paginator.Prev.URL }}">&larr; {{ i18n "newer" }}</a></li>

```

To:

```auto
{{ if .Paginator.HasPrev }}
<li class="previous"><a href="{{ .Site.Params.absURL }}{{ .Paginator.Prev.URL }}">&larr; {{ i18n "newer" }}</a></li>

```

1. You do this for .Paginator.HasPrev and .Paginator.HasNext

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [February 15, 2018, 1:27pm UTC](https://discourse.gohugo.io/t/in-next-page-link-messes-up-s3/4578/7 "2018-02-15T13:27:53Z")

</div>

> [@patrickn](#):
>
> You can see what I mean at [http://neavey.net](http://neavey.net), scroll to the bottom and click Next.

Next works fine for me, and the URL looks perfectly fine: “[neavey.net - Adventure Miles](https://www.neavey.net/page/2/)”

---

<div class="post-metadata">

**Author:** ![patrickn](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/patrickn/32/2256_2.png) [@patrickn](https://discourse.gohugo.io/u/patrickn)\
**Post date:** [February 15, 2018, 1:37pm UTC](https://discourse.gohugo.io/t/in-next-page-link-messes-up-s3/4578/8 "2018-02-15T13:37:15Z")

</div>

That problem was fixed for me some time ago, can’t remember the exact issue but I think a theme update solved it.
