Fix URL handling so correct links are generated when app is not deployed to root on a web server (Apache WSGIScriptAlias other than /)