Handle references to .html pages, for example the link to security. We can
authorMagnus Hagander <magnus@hagander.net>
Fri, 11 Jun 2010 12:37:17 +0000 (14:37 +0200)
committerMagnus Hagander <magnus@hagander.net>
Fri, 11 Jun 2010 12:37:17 +0000 (14:37 +0200)
fix the links, but we need to keep the old references for links coming
in from other sites.

pgweb/legacyurl/views.py
pgweb/urls.py

index 1d08737a4f6a6dd2b6309a92fe6384c3ae23e592..62cbc7c0a5556bde984e22926d43abbff0824274 100644 (file)
@@ -14,3 +14,5 @@ def event(request, eventid):
 def signup(request):
        return HttpResponseRedirect("/account/signup/")
 
+def html_extension(request, prior_to_html):
+       return HttpResponseRedirect("/%s" % prior_to_html)
index f3b6ff8c2c8c735b62e93303499b59701aa8a243..5084c97af6186ac4f70ddd970b986983a8170484 100644 (file)
@@ -92,6 +92,9 @@ urlpatterns = patterns('',
         'document_root': '../media',
     }),
 
+       # If we're getting an attempt for something ending in HTML, just get rid of it
+       (r'^(.*)\.html$', 'pgweb.legacyurl.views.html_extension'),
+
     # Fallback for static pages, must be at the bottom
     (r'^(.*)/$', 'pgweb.core.views.fallback'),
 )