Django Tips #21 Using The Redirects App

Last updated 1 year ago by Vitor Freitas

django

Django comes with a few optional apps that can easily be installed. One of those apps is the Redirects App, which is particularly useful in the cases where you want to update some existing URLs without compromising your Website SEO or in any case avoid 404 errors.

It basically works by creating a table in the database with two columns, oldpath and newpath. Every time your Website raises a 404 error, the Redirects App will intercept the response and check this particular table for a match. If the requested URL is found in the column oldpath, instead of raising the 404 error, it will redirect the user to the newpath returning a 301 code (Moved Permanently).

Read full Article