Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix contrib.redirects so that redirects work for localized URLs #327

Open
Pomax opened this issue Dec 1, 2020 · 2 comments
Open

fix contrib.redirects so that redirects work for localized URLs #327

Pomax opened this issue Dec 1, 2020 · 2 comments

Comments

@Pomax
Copy link
Contributor

Pomax commented Dec 1, 2020

I've written https://github.com/mozilla/foundation.mozilla.org/blob/master/network-api/networkapi/wagtailcustomization/redirects/middleware.py as a wrapper around wagtail.contrib.redirects, so that setting a redirect for /somepage in the CMS will kick in for any /en/somepage, /fr/somepage, etc. etc, but it might be worth moving that into the wagtail-modeltranslation repo instead, with a docs update that explains to use 'wagtail_modeltranslation.middleware.RedirectMiddleware' rather than 'wagtail.contrib.redirects.middleware.RedirectMiddleware' in the MIDDLEWARE = [...] section of the Django settings.

If that sounds like a good idea, I can form a PR with the relevant code and docs changes.

@Pomax
Copy link
Contributor Author

Pomax commented Dec 1, 2020

I've also filed #327 to see if it makes sense to move our solution into wagtail-modeltranslation instead (since it solves a problem that is a consequence of using wagtail-modeltranslation rather than some other localization solution)

@DiogoMarques29
Copy link
Collaborator

Hello @Pomax
Sorry for the waiting.
Sounds like a good idea. You can go ahead and make a PR!
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants