How add headers to static assets?
I have tried
_headers
, functions, and _worker.js
. They works only when there is no static assets matching the request URI. How to add headers to static assets?7 Replies
it should be the path of the file - make sure the path is correct, and also make sure your _headers file is in the output directory
Yes, I make sure those are correct. Actually I know that because they are working, but only for those URIs that do not hit static assets.
@mrparker_lol i have the same issue, What do you mean by output folder? i use create-react-app do i need ot create build folder and then add _headers file?
the output folder is the folder that your assets are in for the pages site (look in build settings)
Assets, Js and Css files are inside the build folder
i use create-react-app
i have also created a build folder and pushed, not sure why it isn't working