I need to run a function on a URL that doesn't contain subdirectories - one that only applies to the root domain, but where the root domain can have query string.
For example, this should match:
- domain.com
- domain.com?utm=blah
- domain.com/?utm=blah
It shouldn't match:
- domain.com/directory
(I can't just check for a /
since that's technically included in even a URL on the root domain.)
I imagine I can get fancy with splitting the URL and all, but wondering if there's an easier way to say, "If the URL after '.com/' either doesn't exist or doesn't start with ?
"...