Modifies redirect to document so that it will work when app is hosted in sub uri