Static pdf files always return 404

I have the problem that I cannot reference my pdf-files on my page via a link.

<a href="/folder/file.pdf">Click</a>

The pdf-files are located in static/folder and are copied in my to my public output directory. When I am just opening “/folder” a blank page is shown, so there must be something on my server.

Does anybody have an idea or a tip in the right direction? :slight_smile:

EDIT: digging the web has not helped me at all unfortunately

Is your Hugo project published in the subdirectory of a domain?

If yes, then try removing the forward slash from the href attribute i.e. <a href="folder/file.pdf">Click</a>

If no, you will need to show us the source of your project and post a link to the published site.

Currently I am testing on the development server. The page that references the pdf is a subpage of my homepage. so removing the first / does not bring the wished results.

EDIT: other static files e.g. images can be accessed as usual via URL in browser

Did you check the permissions of the file?

chmod 644 my-file.pdf

might help?!

Any source code that you can link to?

Follow the advice at Requesting Help and share your code. We will be able to figure it out real quick. Otherwise we are in the same position as you, half-guesses. :slight_smile: