Static pdf files always return 404

#1

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

<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

#2

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.

#3

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

#4

Did you check the permissions of the file?

chmod 644 my-file.pdf

might help?!

#5

Any source code that you can link to?

#6

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: