Fixed flat URLs for app hooks.

Even if flat URLs will be deprecated in 2.4, they should still work in 2.3. This little change fixes them to again work correctly. As changes to support CMS_FLAT_URLS are really small, I would argue that they could be kept in also in future versions.