]> git.ipfire.org Git - people/ric9/ipfire.org.git/commitdiff
init.py: added redirection for legacy location path
authorRico Hoppe <rico.hoppe@ipfire.org>
Sun, 3 Mar 2024 11:29:40 +0000 (11:29 +0000)
committerRico Hoppe <rico.hoppe@ipfire.org>
Sun, 3 Mar 2024 11:29:40 +0000 (11:29 +0000)
Signed-off-by: Rico Hoppe <rico.hoppe@ipfire.org>
src/web/__init__.py

index de561c7ad72d7dace94985ae41f8ec2ae361011d..570d00ee839a8816fc5d1a0b14616eb806a537f9 100644 (file)
@@ -353,9 +353,12 @@ class Application(tornado.web.Application):
                        (r"/static/(.*)", tornado.web.StaticFileHandler, { "path" : self.settings.get("static_path") }),
                ] + authentication_handlers)
 
-               # location.ipfire.org
+               # location.ipfire.org and /projects/location
                self.add_handlers(r"location\.([a-z]+\.dev\.)?ipfire\.org", [
-                       (r"(.*)", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/projects/location{0}" }),
+                       (r"(.*)", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/location{0}" }),
+               ])
+               self.add_handlers(r"www\.([a-z]+\.dev\.)?ipfire\.org", [
+                       (r"/projects/location/(.*)", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/location{0}" }),
                ])
 
                # geoip.ipfire.org