Directory beginning with a period is not deployed

Hello everyone!

I’m using Hugo + GitHub to deploy to Netlify. I noticed that a directory beginning with a period has not been deployed:

https://bytenotfound.com/tags/.net-framework/

When I generate the site on my local machine with Hugo, the directory is there. But when it’s published by Netlify, the directory is not there (I downloaded the published content and confirm that the directory was not published).

My site name:
https://bytenotfound.netlify.app
https://bytenotfound.com/

My GitHub repo: https://github.com/roneda/bytenotfound

Is it possible to publish a directory beginning with a period?

Hey @roneda

Dot files/directories are ignored (e.g. .well-known, .git). You can get around this by creating a rewrite as outlined in this post

Hi @coelmay, thank you! This is how I solved, based on your suggestion:

First, on netlify.toml, I appended the mv command after the hugo build command, to rename the directory from “.net-framework” to “net-framework” (without the dot)

command = "hugo --gc --minify && mv public/tags/.net-framework/ public/tags/net-framework/"

This ensures that the content of “net-framework” is published by Netlify.

Then, I added a redirect rule on netlify.toml:

[[redirects]]
  from = "/tags/.net-framework/"
  to = "/tags/net-framework/"
  status = 200

This way, when someone access the path with the dot, he is redirected to the path without the dot where the content can be found!

Thanks a lot!

1 Like