$site->uri not working in a page controller

That’s an old blog post, it refers to Kirby 1; have a look at this thread Site URI in Kirby 2.0 not working properly