# URL concatenation error when hosting on google

**URL:** https://discourse.gohugo.io/t/url-concatenation-error-when-hosting-on-google/12418
**Category:** support
**Created:** [June 14, 2018, 10:07am UTC](https://discourse.gohugo.io/t/url-concatenation-error-when-hosting-on-google/12418 "2018-06-14T10:07:39Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![patricieni](https://avatars.discourse-cdn.com/v4/letter/p/eb9ed0/32.png) [@patricieni](https://discourse.gohugo.io/u/patricieni)
#### Post date: [June 14, 2018, 10:07am UTC](https://discourse.gohugo.io/t/url-concatenation-error-when-hosting-on-google/12418/1 "2018-06-14T10:07:39Z")

</div>

Hello everyone,

I’ve read similar posts that didn’t work for me:

> [@\[SOLVED\] Url concatenation error when deploying to AWS S3](https://discourse.gohugo.io/t/solved-url-concatenation-error-when-deploying-to-aws-s3/9146):
>
> Hi everyone, I had a problem when deploying my Hugo site from Gitlab to AWS S3. The routing doesn’t work as I expected. For home page, It should be: S3\_BUCKET\_NAME/index.html And when SUB\_FOLDER\_NAME in nav bar gets clicked, it should be: S3\_BUCKET\_NAME/SUB\_FOLDER\_NAME/index.html However it will concatenate the new url with the previous url, for example after SUB\_FOLDER\_NAME in nav bar is clicked, the new url becomes S3\_BUCKET\_NAME/S3\_BUCKET\_NAME/SUB\_FOLDER\_NAME/index.html which is …

> [@Template menu generation .URL messed up using relativeURLs: true](https://discourse.gohugo.io/t/template-menu-generation-url-messed-up-using-relativeurls-true/3527/9):
>
> Note linked topic. If relativeURLs=true then setting canonifyURLs=true will make the URL manipulation done by the menu code not include context root, and therefore not get the path doubled as I posted above. In this case, the canonifyURLs=true will not make all the relative urls canonicalized into absolute urls as one might expect given the docs.

> <https://github.com/HugoBlox/hugo-blox-builder/issues/30>
>
> My baseurl is something like: some.uni.edu/~pdas/ . It seems when the baseurl ha…ve anything with subdirectory, then the internal links are not rendered correctly. When the site is created using hugo command then the /~pdas/ part is omitted by all the internal URLs. As a result the internal links along with the images are not rendered correctly. Also I cannot browse the site when using \`hugo server --watch\` by going to \`localhost:1313\`. I have to go to \`localhost:1313/~pdas\` to browse the site locally.
> 
> This was a bug in \[v0.12\](https://github.com/spf13/hugo/issues/793) which have been resolved in v0.13. There is a possibility that it is related to the theme. Can you please check and let me know?
> 
> For example please see this \[post\](http://www.ece.ucr.edu/~pdas/post/benchmarking-vasp-in-xsede/). Here the image URL are missing the \`~pdas\` part of the URL.

I’m struggling with this issue with the Airspace Themefisher theme. The layouts folder contains only references to BaseURL (i.e. {{ .Site.BaseURL }}img/logo.png). I’ve tried changing the config.toml to have relativeURLS = false but that doesn’t seem to work.

I’ve also tried to add to the theme’s layouts as per tracyghz “| absURL” everywhere where I have BaseURL but that gave me triple concatenation.

The website has been working as expected locally of course.  
I’m not sure why I should change the theme to begin with, since that’s supposed to be correct, any pointers are appreciated.

Patric

---

<div class="post-metadata">

### Author: ![Jura](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jura/32/13581_2.png) [@Jura](https://discourse.gohugo.io/u/Jura)
#### Post date: [June 15, 2018, 4:10pm UTC](https://discourse.gohugo.io/t/url-concatenation-error-when-hosting-on-google/12418/2 "2018-06-15T16:10:01Z")

</div>

Help me understand, what is an ‘URL concatenation error’ in your situation?

Sadly, I don’t have the time to read those three links you posted and then try to estimate what your problem is based on those ‘similar posts’. Can you perhaps post more about your website and settings? Particularly the `baseURL` setting would be helpful, since that might be causing your problems.

---

<div class="post-metadata">

### Author: ![patricieni](https://avatars.discourse-cdn.com/v4/letter/p/eb9ed0/32.png) [@patricieni](https://discourse.gohugo.io/u/patricieni)
#### Post date: [June 15, 2018, 4:34pm UTC](https://discourse.gohugo.io/t/url-concatenation-error-when-hosting-on-google/12418/3 "2018-06-15T16:34:44Z")

</div>

Thanks Jura,  
The problem was that the baseURL was appending to itself so I’d get something like:  
[www.example.com/example.com](http://www.example.com/example.com)

I managed to fix it by removing some “/” from various places and adding one to my website i.e. [www.example.com](http://www.example.com)\*\*/\*\*

So the issue can be closed I guess.
