# baseURL with subfolder: why is it not working?

**URL:** https://discourse.gohugo.io/t/baseurl-with-subfolder-why-is-it-not-working/50786
**Category:** support
**Tags:** configuration
**Created:** [July 19, 2024, 1:18pm UTC](https://discourse.gohugo.io/t/baseurl-with-subfolder-why-is-it-not-working/50786 "2024-07-19T13:18:14Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![irkode](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/irkode/32/26135_2.png) [@irkode](https://discourse.gohugo.io/u/irkode)
#### Post date: [July 19, 2024, 1:51pm UTC](https://discourse.gohugo.io/t/baseurl-with-subfolder-why-is-it-not-working/50786/2 "2024-07-19T13:51:29Z")

</div>

Check out this one:

> [@How to handle URLs when in a subfolder?](https://discourse.gohugo.io/t/how-to-handle-urls-when-in-a-subfolder/42260/4):
>
> Let’s say that: Your images and CSS files are in your project’s static directory, AND Your baseof.html looks something like this: \<html\>\> \<head\> \<link rel="stylesheet" href="/css/main.css"\> \</head\> \<body\> \<img src="/images/b.jpg"\> \<a href="/posts/post-1"\>Post 1\</a\> \</body\> \</html\> When you serve the site from a subdirectory, all of the links will fail. There are several ways to handle this. Method 1 - Hardcode the links \<link rel="stylesheet" href="/subdirectory/css/main.css"\> This…

---

_[View the full topic](https://discourse.gohugo.io/t/baseurl-with-subfolder-why-is-it-not-working/50786)._
