Django redirects with regular expressions

2 september 2013 - Alex - regex - django - python - Development - Django

We've been doing quite a few projects lately where old incoming links need redirecting to new pages (both for visitors and the much sought-after Google juice). In such projects SEO is mostly tacked-on as an afterthought and often neglected, however giving your users the tools to set this up themselves is always appreciated.

The default redirects app in Django works pretty well for users, but with larger websites its simplicity doesn't cut it. The quick workaround is adding regular expressions to your Apache/Nginx with rewrites or (ugh) hard-coding them in your urls.py, which works and ensures that your users are going to keep needing you for every little change. Hopefully there are more interesting things you can with your time than tinkering with redirects!

The repository below contains a slightly modified django.contrib.redirects to give your users regular expression redirects and a couple of other features.

  • Redirect your visitors using regular expressions
  • Configurable via the admin
  • Counts the number of visitors
  • Redirects are exportable as .csv
https://github.com/maykinmedia/django-regex-redirects



Latest Tweets