Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Do not match trailing slash by default in page regex

Uku Tahtebc59313a507
diff --git a/lib/plausible/stats/base.ex b/lib/plausible/stats/base.ex
index 9543de4e2d..c4c7316e7d 100644
--- a/lib/plausible/stats/base.ex
+++ b/lib/plausible/stats/base.ex
@@ -347,7 +347,7 @@ defmodule Plausible.Stats.Base do
end
def page_regex(expr) do
- "^#{expr}\/?$"
+ "^#{expr}$"
|> String.replace(~r/\*\*/, ".*")
|> String.replace(~r/(?<!\.)\*/, "[^/]*")
end