# Ssl and localhost

**URL:** <https://discourse.gohugo.io/t/ssl-and-localhost/622>\
**Category:** support\
**Created:** [January 22, 2015, 1:58pm UTC](https://discourse.gohugo.io/t/ssl-and-localhost/622 "2015-01-22T13:58:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![brad](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/brad/32/63_2.png) [@brad](https://discourse.gohugo.io/u/brad)\
**Post date:** [January 22, 2015, 1:58pm UTC](https://discourse.gohugo.io/t/ssl-and-localhost/622/1 "2015-01-22T13:58:49Z")

</div>

Because my site is all SSL i set my baseurl to reflect that:

```
baseurl: https://example.com/

```

This caused some problems when developing locally because all generated links point to [https://localhost:1313](https://localhost:1313). I figured i could set the URLs to be relative somehow and found this

```
canonifyurls: false

```

However, that isn’t actually working. All my generated URLs still contain the domain. I’ve restarted the server and all that. Am i missing something?

```
$ hugo version
Hugo Static Site Generator v0.13-DEV buildDate: 2014-11-24T18:04:18-05:00
```

---

<div class="post-metadata">

**Author:** ![tatsushid](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/tatsushid/32/7219_2.png) [@tatsushid](https://discourse.gohugo.io/u/tatsushid)\
**Post date:** [January 22, 2015, 10:59pm UTC](https://discourse.gohugo.io/t/ssl-and-localhost/622/2 "2015-01-22T22:59:53Z")

</div>

I noticed this too. In my case, all URLs which is generated by `{{ .RelPermalink }}` are OK but the menu items URLs are overwritten by baseUrl + menu item’s URL even if canonifyurls is disabled. It seems to be caused by [https://github.com/spf13/hugo/blob/master/hugolib/site.go#L613](https://github.com/spf13/hugo/blob/master/hugolib/site.go#L613) but simply removing it may cause the other problems.

---

<div class="post-metadata">

**Author:** ![tatsushid](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/tatsushid/32/7219_2.png) [@tatsushid](https://discourse.gohugo.io/u/tatsushid)\
**Post date:** [January 22, 2015, 11:01pm UTC](https://discourse.gohugo.io/t/ssl-and-localhost/622/3 "2015-01-22T23:01:48Z")

</div>

Forgot to write what version I use. Mine is

```auto
$ ./hugo version
Hugo Static Site Generator v0.13-DEV-01EC44A BuildDate: 2015-01-23T06:56:32+09:00

```

The current tip.

---

<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:** [January 22, 2015, 11:49pm UTC](https://discourse.gohugo.io/t/ssl-and-localhost/622/4 "2015-01-22T23:49:36Z")

</div>

The line in question is mine.

I tried describe some of this mess here:

> <https://github.com/gohugoio/hugo/issues/711>
>
> I was bitten by this trying to fix #519.
> Given:
> BaseUrl: http://somehost.com/sub
> CanonifyUrls=true
> RelPermalink for a page will give
> http://somehost.com/sub/sub/rest-of-url
> Not sure if this is easily fixable....

But you could avoid this by

```
hugo server -b http://localhost:1313
```

---

<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:** [January 23, 2015, 1:16pm UTC](https://discourse.gohugo.io/t/ssl-and-localhost/622/5 "2015-01-23T13:16:12Z")

</div>

I believe I have cleaned up this mess with this commit:

> <https://github.com/gohugoio/hugo/commit/1b42dc572a0475596ffc64f8a9e0dbf8ec823094>

Please test and shout if it doesn’t work …
