cloudflare-docs
cloudflare-docs copied to clipboard
Added note for frameworks
Added a note that states an issue with Cloudflare Pages according to which Redirects would only work if the site does not have any framework.
The issue here is with the way some of these frameworks like Jekyll work, by generating a simple and static HTML/CSS/JS version of an entire project inside of a _site folder (in which we cannot write any extra file manually) and that's probably what is finally being deployed to Cloudflare's network. Because of this, even if the root folder of a project had a _redirects file, it would not be found in the deployed directory.
Hey,
This isn’t an issue, more of an implementation detail. You can get this to work by copying the file into the _site dir after it’s built.
So, your build command could be like jekyll build && cp _redirects _site/_redirects
I’d say we probably just make that an aside in the Jekyll guide rather than adding an aside here.
Thoughts @deadlypants1973 ?
Thanks for sending the workaround. This is really helpful for people like me who were confused, while a separate guide on it would be great I would still like to see a reference about this issue on the redirects docs.