Skip to content

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

@Pomax

Description

@Pomax

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions