Hello everyone I want to redirect urls like this
from
https://www.example.co.uk/pages/terms-conditions
to
https://www.example.co.uk/terms-conditions
I developed updated site using django framework and now want to redirect old site urls to new urls and not loosing traffic. what is the best way of doing…?
If it’s a case where you always want to redirect all urls in the pages/
component to the same location without pages/
(e.g. from https://domain.tld/pages/some-url
to https://domain.tld/some-url
), then I’d be tempted to manage that within my web server rather than within django.
However, if’s it just a case where you have some specific pages that need to be redirected to a different location, you can use the RedirectView
.
If you have a lot of them to manage, there’s also the redirects app.