Skip to main content

Introduction

by Martin Aspeli <optilude@gmx.net> based on work by Helge Tesdal (RedirectionTool) and Whit Morriss (topp.rose).

Bring dead links back to life! plone.app.redirector knows where your content used to be and can bring you to its new location when content moves.

This component expects you to register storage.RedirectionStorage as a local utility providing IRedirectionStorage (CMFPlone does this). Once that’s done, the subscribers in subscribers.py will listen for object moved and object deleted events.

When an object is moved (renamed or cut/pasted into a different location), the redirection storage will remember the old path. It is smart enough to deal with transitive references (if we have a -> b and then add b -> c, it is replaced by a reference a -> c) and circular references (attempting to add a -> a does nothing).

When an object is deleted, all references to it are deleted as well.

The view in browser.py contains methods (used in Plone’s default_error_message.pt when it gets a NotFound error) that do the following:

  • attempt to redirect from the assumed intended path to the new path of an object, if the redirection storage holds a reference from the old path.

  • if not, look for the first valid parent of the assumed intended path, and present it as an option to the user

  • further, use the last id of the assumed intended path and attempt to search for objects in the catalog that contain this, presenting the options to the user

Changelog

4.0.0 (2026-05-16)

Internal:

  • Update configuration files. [plone devs]

4.0.0a1 (2025-11-19)

Breaking changes:

  • Replace pkg_resources namespace with PEP 420 native namespace. Support only Plone 6.2 and Python 3.10+. (#3928)

3.0.5 (2025-09-11)

Internal:

  • Move distribution to src layout [gforcada] (#4217)

3.0.4 (2025-01-24)

Bug fixes:

  • Fix DeprecationWarnings. [maurits] (#4090)

3.0.3 (2024-06-13)

Internal:

  • Update configuration files. [plone devs] (6e36bcc4)

Tests

  • Remove test test_find_first_parent_not_viewable that lost its environment in Plone 6 [@jensens] (#42)

3.0.2 (2024-01-19)

Internal:

  • Update configuration files. [plone devs] (7723aeaf)

3.0.1 (2023-04-15)

Internal:

  • Update configuration files. [plone devs] (93e1ab65)

3.0.0 (2022-11-30)

Bug fixes:

  • Final release. [gforcada] (#600)

3.0.0a1 (2022-04-08)

Breaking changes:

  • Plone 6 only, remove Archetypes specific code. Also Code modernization (black, isort, pyupgrade). [jensens] (modernize)

2.2.1 (2020-04-20)

Bug fixes:

  • Minor packaging updates. (#1)

2.2.0 (2020-03-13)

New features:

  • The http status of the response is changed from 301 (Moved Permanently) to 302 (Found) for GET requests and to 307 (Temporary Redirect) for other request methods because nothing prevents the URL to be reused in the future. [ale-rt] (#8)

2.1.1 (2019-12-10)

Bug fixes:

  • Allow performance tests to take more time. This seems needed on the Plone Jenkins test server when jobs are run in parallel. [maurits] (#20)

2.1.0 (2019-04-29)

New features:

  • Store date information in the paths. Can be used as basis for removing for example all redirects that are older than a year. [maurits] (#17)

  • Keep track if a redirect was added manually or automatically. [maurits] (#18)

2.0.1 (2019-03-03)

New features:

  • Support using the ‘in’ operator for paths. Support using storage[old_path] to get the new path, possibly raising KeyError. Support using storage[old_path] to set or delete new paths. Support using len(storage) to get the number of paths. Support storage.clear() to clear out all data. Support storage.update() for bulk updates. Added performance tests. Call with export PLONE_APP_REDIRECTOR_PERFORMANCE_NUMBER=100000 to enable. [maurits] (#13)

Bug fixes:

  • Turned doctests into unittests. Removed no longer needed test_suite functions. [maurits] (#12)

2.0.0 (2019-02-13)

Breaking changes:

  • No longer try to check portal_redirection for allowed types. This was from Products.RedirectionTool, which is scheduled to be merged into CMFPlone 5.2. The feature to allow redirections only for specific types will be either removed or changed. [maurits] (#1486)

1.3.7 (2018-11-21)

Bug fixes:

  • Cleanup project level files (setup.py, pyproject.toml) [maurits] [gforcada] (#2524)

1.3.6 (2018-02-02)

Bug fixes:

  • Add Python 2 / 3 compatibility [vincero]

1.3.5 (2017-06-20)

Bug fixes:

  • remove unittest2 dependency [kakshay21]

1.3.4 (2017-01-12)

Bug fixes:

  • Don’t test repr of tree iterator. [davisagli]

1.3.3 (2016-11-10)

Bug fixes:

  • Add coding header on python files. [gforcada]

1.3.2 (2016-08-18)

Fixes:

  • Use zope.interface decorator. [gforcada]

1.3.1 (2015-09-09)

  • Fixed tests to use registry for value lookup. [esteele]

1.3 (2015-08-14)

  • Rerelease of 1.2.1 as 1.3 for clarity. This is for Plone 5 only. [maurits]

1.2.2 (2015-08-14)

  • Rerelease of same code as 1.2. The changes from 1.2.1 are for Plone 5. [maurits]

1.2.1 (2014-02-26)

  • Rename without using folder_contents. [davisagli]

  • Use p.a.contenttypes test fixture and adapt/fix failing tests due to the ATContentTypes removal from PLONE_FIXTURE in Plone 5. [timo]

1.2 (2013-05-26)

  • Support redirecting to external URLs. [rpatterson]

1.2a1 (2012-07-02)

  • Import object events from zope.lifecycleevent. [davisagli]

  • Move tests from PloneTestCase to plone.app.testing. [timo]

1.1.3 (2012-05-07)

  • Support parts of views e.g. mypage/@@myview/somepart [anthonygerrard]

  • #12354 will redirect based on the query string as well as path if query_string stored. [djay]

  • #9967 will append the same query string after redirecting to be more tracker friendly. [djay]

  • #12858 first suggestion on not found page can be unsuitable [anthonygerrard]

1.1.2 - 2011-07-05

  • Don’t break in the objectMoved handler if the request has no ACTUAL_URL, to facilitate testing. [davisagli]

  • Add MANIFEST.in. [WouterVH]

1.1.1 - 2011-03-02

  • Gracefully handle errors parsing the SearchableText query on the 404 view. [davisagli]

1.1 - 2010-07-18

  • Update license to GPL version 2 only. [hannosch]

1.0.13 - 2010-01-25

  • Added optional support for the getRedirectionAllowedForTypes method of Products.RedirectionTool. [hannosch]

1.0.12 - 2009-06-17

  • Fix bad calling convention in IFourOhFourView definition. [wichert]

  • Move event subscribers to a separate zcml file so they can easily be excluded. [wichert]

  • Update browser view to handle environments where the storage utility is not available. [wichert]

1.0.11 - 2009-04-05

  • Fixed multiple steps circular references #8840 [gotcha]

  • Fixed a bug which caused URLs with %-escaped sequences to grow extra %25s upon redirect. [erikrose]

1.0.10 - 2009-03-07

  • Fixed tests to be independent of any default content. [hannosch]

  • Fixed a test to be less dependent on the page rendering. [hannosch]

  • Added quotation marks around open and close parens. This fixes http://dev.plone.org/plone/ticket/8588. [MatthewWilkes]

1.0.9 - 2008-07-07

  • Fix for the fix regarding unnecessary creation of redirection entries for newly created objects. [witsch]

1.0.8 - 2008-07-07

  • Fix release confusion by ensuring we have a “late” version number. Somewhere, someone created a 1.0.7. :-) [optilude]

1.0.6 - 2008-07-07

  • Fix unnecessary creation of redirection entries for newly created objects. [witsch]

1.0.5 - 2008-01-03

  • Start searches for missing items in the navigation root instead of the site root. [wichert]

1.0.2 - 2007-10-08

  • also ignore ids from views. [ldr]

  • Added __iter__ function to storage which iterates over all paths. [fschulze]

1.0 - 2007-08-17

  • Initial release. [optilude]

Release files for plone.app.redirector 4.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for plone.app.redirector 4.0.0
File Size Uploaded
plone_app_redirector-4.0.0.tar.gz 31.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for plone.app.redirector 4.0.0
File Interpreter ABI Platform
plone_app_redirector-4.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 54.1 kB

Release files / plone_app_redirector-4.0.0.tar.gz

Download URL plone_app_redirector-4.0.0.tar.gz
Size 31.0 kB
Tags Source
SHA-256 checksum
How to use checksums
43c17c1d6d81bfe6a4e576daa901b2ff2c85d75a4e30320fc931621d00db841a
BLAKE2b-256 checksum
How to use checksums
20bade9cbd78b1750621d497a341241adbca418348e9c98ac82318ca6be25291
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / plone_app_redirector-4.0.0-py3-none-any.whl

Download URL plone_app_redirector-4.0.0-py3-none-any.whl
Size 23.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7f22306ccb710a3ec7ea19a9720a3e58418d006c0228b86ca3e7c958594bd8b
BLAKE2b-256 checksum
How to use checksums
51cfa3e0132d4dbe200a9331fbae28526e431a5c0f9fa932c8207375b7aa990c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release history Release notifications | RSS feed

This release

4.0.0 This release

2 release files

3.0.5

2 release files

3.0.4

2 release files

3.0.3

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.3.7

2 release files

1.3.6

2 release files

1.3.5

2 release files

1.3.4

1 release file

1.3.3

1 release file

1.3.2

1 release file

1.3.1

1 release file

1.3

1 release file

1.2.2

1 release file

1.2.1

1 release file

1.2

1 release file

1.1.3

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1

1 release file

1.0.13

1 release file

1.0.12

1 release file

1.0.11

1 release file

1.0.10

1 release file

1.0.9

1 release file

1.0.8

1 release file

1.0.7

2 release files

1.0.6

1 release file

1.0.5

2 release files

1.0.2

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page