My website’s main app contains around 12,000 pages, and I want to break out a small portion (~ 1%) into a new app with different URLs but keep the original URLs as redirects. The dispatcher config looks something like this:
# newapp.urls.py
path('newapp/<slug:page_url>', views.generic_newapp, name='generic_newapp')
# mainapp.urls.py
path('<slug:page_url>', views.generic, name='generic')
If I modify the main app’s generic view to execute redirect('generic_newapp', page_url=page_url)
every time a page (page_url
) is not found in the main app, the users will receive a correct 200 or 404 response in the end, but at the expense of them being sent to newapp/some_non_existing_url_name
for every URL that does not exist in either app.
Is there a better way to handle the migration of 120 pages to a different app transparently without affecting the majority of pages/URLs?