Answer the question
In order to leave comments, you need to log in
How to compose a redirect regular expression in Django?
When moving from the old site, many pages remained with such addresses
https://mysite.ru/14-prodaja-vsego/?pag=10000&page...
https://mysite.ru/14-prodaja-vsego?pag=50&page= 9++...
https://mysite.ru/14-prodaja-pvsego/?pag=50&page=8
https://mysite.ru/14-prodaja-vsego/?pag=30&page=6+...
they give a 404 error
, I want to insert a regular expression in urls.py to redirect, ideally to
https://mysite.ru/14-prodaja-vsego/?pag=10000&page... to https://mysite.ru/14-prodaja -vsego/?page=9
https://mysite.ru/14-prodaja-pvsego/?pag=50&page=8 to https://mysite.ru/14-prodaja-pvsego/?page=8
and so on, but it is possible and simple:
https://mysite.ru/14-prodaja-pvsego/
Django has a RedirectView, but how do you make a regular expression?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question