2021年3月25日星期四

301 redirect router for Django project

I have a website building tool created in Django and I'd like to add easy user defined 301 redirects to it.

Webflow has a very easy to understand tool for 301 redirects. You add a path (not just a slug) and then define where that path should lead the user.

enter image description here

I'd like to do the same for the Django project I'm working on. I currently allow users to set a slug that redirects (/<slug:redirect_slug>/) and they can set to go to any URL. But I'd like them to be able to add, for example, the path for an old blog post ('/2018/04/12/my-favorite-thing/')

What's the best URL conf to use in Django to safely accept any path the user wants?

https://stackoverflow.com/questions/66735533/301-redirect-router-for-django-project March 22, 2021 at 01:40AM

没有评论:

发表评论