Route for homepage with and without URL parameters?

Hello dear cloudflare users and superstars !

I’m trying to implement an A/B split testing worker on my homepage (and just the homepage).

But I can’t find a wildcarded route that works to filter both :

  • Just the homepage traffic :
  • With or without URL parameters :

if route = domain.com >> homepage with URL parameters is not included
if route = domain.com* or com/* >> includes all pages on that domain instead of just the homepage

Is my only choice to filter in the worker code directly ?

Thank you very much for your time and help ! :slight_smile:

Route should be https://www.example.com/* if it doesn’t behave like wildcard there could be something wrong in the script.

Works for homepage Et al.

I ended up with both routes :

And then filtering in the worker :
var is_root = url.pathname == “/”;
if (!is_root) return await fetch(request) // Not root ? No split test, returns current URL