-
Notifications
You must be signed in to change notification settings - Fork 7
/
main.py
45 lines (39 loc) · 1.49 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import webapp2
class SlashRedirect(webapp2.RequestHandler):
def get(self, *args, **kwargs):
self.redirect('//' + self.request.host + '/io/')
class Ioxkl19(webapp2.RequestHandler):
def get(self, *args, **kwargs):
path = self.request.path_qs.split('/')
if (path[1] != 'ioxkl19'):
self.redirect('https://www.gdgkl.org')
else:
self.redirect('//' + self.request.host + '/io/' + '/'.join(path[2:]))
class Io19extended(webapp2.RequestHandler):
def get(self, *args, **kwargs):
path = self.request.path_qs.split('/')
if (path[1] != 'io19extended'):
self.redirect('https://www.gdgkl.org')
else:
self.redirect('//' + self.request.host + '/io/' + '/'.join(path[2:]))
class Io2019(webapp2.RequestHandler):
def get(self, *args, **kwargs):
path = self.request.path_qs.split('/')
if (path[1] != 'io2019'):
self.redirect('https://www.gdgkl.org')
else:
self.redirect('//' + self.request.host + '/io/' + '/'.join(path[2:]))
class Io19(webapp2.RequestHandler):
def get(self, *args, **kwargs):
path = self.request.path_qs.split('/')
if (path[1] != 'io19'):
self.redirect('https://www.gdgkl.org')
else:
self.redirect('//' + self.request.host + '/io/' + '/'.join(path[2:]))
app = webapp2.WSGIApplication([
('/io.*', SlashRedirect),
('/ioxkl19.*', Ioxkl19),
('/io19extended.*', Io19extended),
('/io2019.*', Io2019),
('/io19.*', Io19)
], debug=True)