Exclude paths from Worker routes

I want to redirect based on the Geo location header. I configured my worker to run on route:
https://www.example.com/*.

From now on https://www.example.com = because I am not allowed to post more that 2 links…

I wonder if its possible to exclude some paths from running the Worker? For example I don’t want the worker to run on CSS, JS or image resources, I only want it to run when the HTML has been requested.

For example I want to run the Worker on paths:
/home/, /about/ …

But I DON’T want the Worker to run on paths:
/some-script.js, /some-css.css, /image.jpeg, …

Is it possible to NOT run the Worker when a certain suffix is present eg: .js, .css?

Just add another worker route for those you want disabled and select worker to be disabled.

Image 2020-11-05 at 11.23.06 AM

If you have a lot of these, I’d suggest adding a router to the script itself.

2 Likes

Thanks for the response, I didn’t think this was possible. I will look into it.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.