Sign in

netlify.toml and _headers do not work for Netlify hosting

  • This topic has 1 reply, 2 voices, and was last updated 2 years ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #6319
    Avatar photoNitaaiKumar

    I was trying to increase the cache time via Netlify’s Custom Headers.

    I tried both with netlify.toml and _headers files and uploaded them in the root directory via the File manager.

    I confirmed that the custom header caching code is right via Netlify’s playground.

    But either of these files don’t seem to have been uploaded to the site root as I can’t access them via their URL or if they have been uploaded and I can’t access them via the browser, they still don’t seem to be working. Because no custom caching header seems to have been added to the site. I can’t access the site via ftp to check as netlify does not support ftp.

    So what am I doing wrong? Why are they not working? Netlify says they should be in the site root. Is Publii not uploading either of these two files even if I upload them to the file manager? Thanks in advance.

    #6328
    Avatar photoTomasz Dziuda

    Hi,

    I suppose that the files are uploaded properly but Netlify do not allow access them – I have made a simple test – I have create a catalog with index.html and _headers file – created ZIP from it and uploaded to netlify.

    The _headers file shows Page Not Found and in my opinion it is a correct behaviour because such files shouldn’t be publicly available (like .htaccess files on Apache servers).

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.