Netlify deploy API removes files and directories beginning with a period

I use the deploy API to deploy my site with a zip file. I discovered today that apparently Netlify removes files and directories within the zip file that begin with a period.

This is problematic as my site has a “.well-known” directory, which used by a variety of Internet standards. This directory is included in the zip file that I send to the Netlify API, but it is not present when I download my deployed site from Netlify nor can I access any of the files within that directory in the browser.

I’m not sure about the API but deploy with Git works fine. This issue did exist in the past, but was then changed: dotfiles are ignored by 'netlify deploy' · Issue #11 · netlify/cli · GitHub

1 Like

@gpanders Welcome to the Netlify community. The link provided by @hrishikesh shows a work-around for this behavior regarding .well-known directories.

Hi @gregraven,

The comment in that GitHub thread mentions that dot files are ignored except for .well-known; however, I’m not seeing the .well-known directory in the deployed site (these are the only dot files I have in my site that I care about).

The “workaround” of simply issuing a redirect is a hack and is not a satisfactory solution.

The workaround is not required anymore and as I already said, that thread is only valid for Netlify CLI.

Have you tried deploying through CLI or Git?

1 Like

Indeed I have used both approaches in the past, but deploying a zip file through the API endpoint is the best solution for me: my git hoster is not supported by Netlify (so to use git deploy I would need to mirror to GitHub) and the netlify CLI command has a lot of dependencies and takes a long time to download. Since my site is deployed in a CI pipeline that starts from scratch each time, it’s much simpler and faster to simply install curl and zip and deploy the site that way.

I can use one of those two solutions as a temporary workaround, but I wanted to bring the issue of the disappearing dotfiles to the attention of Netlify in hopes of a fix. Hopefully since it’s already been addressed for git and CLI deploys, fixing it for the API should be straightforward.

Alright, I’m taking it as a confirmation that it’s working via the other two options. Let us know if that’s not the case.

I’m also upgrading this thread to the official support team so that they can check and confirm.

I hate to be the “any status update” person but…any status update? I maintain a static site generator with built-in Netlify deployment (Statiq) and it uses the REST API with zip files to deploy sites. I’ve had reports from users the mirror this exact problem - they add a .well-known folder to the site, it gets generated and output as expected, but on deploying their site (as a zip file via the Netlify API) the .well-known folder is dropped. Thanks!

Hiya @Dave_Glick ,

I do not believe we are planning any changes here, so nothing has changed.

If you need a path to be served at this path, you’d either:

  • deploy via git
  • or use a redirect or proxy redirect from /.well-known/whatever to a static file that doesn’t start with a dot:

/.well-known/my-path/* /file-i-want-served.html 200!

Please let me know if the second one isn’t an option for you for some reason and why and we can discuss other less optimal workarounds.