Added a hook to override the way a base path is calculated. This can be useful for people who are using url rewriting.