diff --git a/couchpotato/__init__.py b/couchpotato/__init__.py index 3e283639..c3b1bd81 100644 --- a/couchpotato/__init__.py +++ b/couchpotato/__init__.py @@ -69,10 +69,10 @@ def getApiKey(): @app.errorhandler(404) def page_not_found(error): index_url = url_for('web.index') - url = getattr(request, 'path')[len(index_url):] + url = request.path[len(index_url):] if url[:3] != 'api': - return redirect(index_url + '#' + url) + return redirect(request.url.replace(request.path, index_url + '#' + url)) else: time.sleep(0.1) return 'Wrong API key used', 404