# Absolute\_url rendering links as http://localhost?

**URL:** <https://talk.jekyllrb.com/t/absolute-url-rendering-links-as-http-localhost/3293>\
**Category:** Uncategorized\
**Created:** [September 5, 2019, 12:38pm UTC](https://talk.jekyllrb.com/t/absolute-url-rendering-links-as-http-localhost/3293 "2019-09-05T12:38:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![terribledevice](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/terribledevice/32/1885_2.png) [@terribledevice](https://talk.jekyllrb.com/u/terribledevice)\
**Post date:** [September 5, 2019, 12:38pm UTC](https://talk.jekyllrb.com/t/absolute-url-rendering-links-as-http-localhost/3293/1 "2019-09-05T12:38:01Z")

</div>

For some reason, whenever I use `{{ absolute_url }}` in my templates, but the links render as `http://localhost:4000.` I have my website’s url in the \_config.yml file as `url: "https://www.mywebsite.com"` and `baseurl: ""` is left empty. Any thoughts on what could be happening here? I build the site locally with `bundle exec jekyll s`, and then upload the everything to my server afterwards. I’m using jekyll 4.0.0. I’m also using a fork of the following template for my site:

> **[terribledevice/forty-jekyll-theme](https://github.com/terribledevice/forty-jekyll-theme)**
>
> A Jekyll version of the "Forty" theme by HTML5 UP. - terribledevice/forty-jekyll-theme

---

<div class="post-metadata">

**Author:** ![terribledevice](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/terribledevice/32/1885_2.png) [@terribledevice](https://talk.jekyllrb.com/u/terribledevice)\
**Post date:** [September 5, 2019, 12:58pm UTC](https://talk.jekyllrb.com/t/absolute-url-rendering-links-as-http-localhost/3293/2 "2019-09-05T12:58:49Z")

</div>

Figured it out, finally. You have to use the production environment variable when building the site. Here’s what I used.

`JEKYLL_ENV="production" bundle exec jekyll build`

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [September 5, 2019, 3:57pm UTC](https://talk.jekyllrb.com/t/absolute-url-rendering-links-as-http-localhost/3293/3 "2019-09-05T15:57:50Z")

</div>

did you try `build` without the production flag? serve is meant for local dev so it does a few things differently than build.
