diff --git a/onlineweb4/urls.py b/onlineweb4/urls.py index 0d73ea417..8f64bc34b 100644 --- a/onlineweb4/urls.py +++ b/onlineweb4/urls.py @@ -2,6 +2,7 @@ from django.conf.urls.static import static from django.contrib import admin from django.http import HttpResponse +from django.shortcuts import redirect from django.urls import include, path, re_path from django.views.generic import TemplateView from django_js_reverse.views import urls_js @@ -19,6 +20,9 @@ class HomePageView(TemplateView): template_name = "frontpage.html" +def redirect_to_new_wiki(request, path): + return redirect(f"https://wiki.online.ntnu.no/{path}", permanent=True) + urlpatterns = [ # Admin urls re_path(r"^admin/doc/", include("django.contrib.admindocs.urls")), @@ -58,6 +62,8 @@ class HomePageView(TemplateView): ), # Wiki re_path(r"^notify/", include("django_nyt.urls")), + re_path(r"^wiki/online/(?!komiteer/)(?P([^/]+/)*)$", redirect_to_new_wiki), + re_path(r"^wiki/$", lambda r: redirect_to_new_wiki(r, "")), re_path(r"^wiki/", include("wiki.urls")), ] diff --git a/templates/base.html b/templates/base.html index c33946781..a367b0a33 100755 --- a/templates/base.html +++ b/templates/base.html @@ -49,7 +49,7 @@
  • Arrangementer
  • Karriere
  • -
  • Wiki
  • +
  • Wiki
  • Webshop