Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Redirect responses are currently not supported in Tome, but should be.
Proposed resolution
Create an API for handling redirects, that can be extended to generate an .htaccess file or Netlify _redirects file before falling back to an HTML redirect (with <meta http-equiv="refresh" content="0; url=..." />
).
Remaining tasks
Write a patch.
User interface changes
None.
API changes
TBD.
Data model changes
None.
Release notes snippet
TBD.
Comment | File | Size | Author |
---|---|---|---|
#10 | interdiff-3017423-9-10.txt | 972 bytes | samuel.mortenson |
#10 | 3017423-10.patch | 13.13 KB | samuel.mortenson |
|
Comments
Comment #2
samuel.mortensonHere's a start to this, should have time before beta 2 to add tests. Still need to add some kind of event API for reacting to responses.
Comment #3
samuel.mortensonTest coverage added, need to add the API.
Comment #4
samuel.mortensonThis event should be enough to generate a redirects file.
Comment #6
samuel.mortensonHuh, didn't know this annotation was possible.
Comment #7
samuel.mortensonThis looks good, but I'm wondering if instead of a new event, we could just flag Tome requests in a way that typical Response subscribers could pick up on - No new API necessary.
Comment #8
samuel.mortensonThis feels way better.
Comment #9
samuel.mortensonComment #10
samuel.mortensonComment #12
samuel.mortensonComment #14
dpiIf anyone is trawling through Tome code and is wondering how/where the redirect is added, it can be found in Symfony as a form of a fallback to
Location
headers in\Symfony\Component\HttpFoundation\RedirectResponse
.