From 6a55771630cd96b91881dddcb62bc54b01a7b2a8 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Sat, 7 Sep 2019 21:40:38 -0700 Subject: Redirect localhost:8080 to homepage --- server.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server.py b/server.py index 4b39b5a..ac30156 100644 --- a/server.py +++ b/server.py @@ -81,6 +81,11 @@ def site_dispatch(env, start_response): yield error_code('403 Forbidden', start_response) return + # redirect localhost:8080 to localhost:8080/https://youtube.com + if path == '' or path == '/': + start_response('302 Found', [('Location', '/https://youtube.com')]) + return + try: env['SERVER_NAME'], env['PATH_INFO'] = split_url(path[1:]) except ValueError: -- cgit v1.2.3