Multiple Cloudflare Workers route to different URL paths
Hi everyone,
I want to route several Cloudflare Workers to different paths on a subdomain. For example:
Page1: subdomain.example.com/Page1
Page2: subdomain.example.com/Page2
I've tried but it does not work. Here's my wrangler.jsonc:
3 Replies
When I deployed, it seems that it matches the assets located in:
site/Page1/, not site.
I've spent several hours on this. If you've done this before, please help me out a bit.
I'm new to Cloudflare workers.
My sites are built with mkdocsHi @Thomas!
I would recommend reading through these docs if you haven't already, hopefully these provide some help: https://developers.cloudflare.com/workers/static-assets/routing/advanced/html-handling/
Looking into it a bit more, I believe that this would be intended behavior based on this documentation: https://developers.cloudflare.com/workers/static-assets/routing/advanced/serving-a-subdirectory/
In this example, requests to example.com/blog/ will serve the index.html file, and requests to example.com/blog/posts/post1 will serve the post1.html file.
Thank you