get the baseUrl and make it work for error pages too! (team effort!)