-
Notifications
You must be signed in to change notification settings - Fork 606
Description
Following a recent AEM as a Cloud Service maintenance release β documented here:
π AEM Maintenance Release Notes β and the upgrade to Apache HTTP Server version 2.4.63, a breaking change was introduced in how mod_rewrite handles question marks (?) in URLs.
As a result of this change, Redirect Manager will no longer function correctly when the target URL includes a ? character. Redirects that previously worked with query strings now fail or behave unexpectedly.
Root Cause:
Apache HTTPD 2.4.63 introduced a change in mod_rewrite that alters how the ? character is processed in rewrite and redirect rules. This impacts scenarios where the destination URL contains a query string.
Workaround:
The only currently known workaround is to explicitly add the UnsafeAllow3F flag to the redirect rule.
This flag re-enables support for ? characters in target URLs, allowing the redirect to function as it did prior to the upgrade.
# The Redirect Manager-managed map
RewriteMap site_redirects dbm=sdbm:/tmp/rewrites/site_redirects.map
# If the redirect mapped value contains `.html`
RewriteCond ${site_redirects:$1} !=""
RewriteCond ${site_redirects:$1} \.html
RewriteRule ^(.*)$ ${site_redirects:$1|/} [R=301,L,UnsafeAllow3F]
# If the redirect mapped value does NOT contain `.html`, append it
RewriteCond ${site_redirects:$1} !=""
RewriteCond ${site_redirects:$1} !\.html
RewriteRule ^(.*)$ ${site_redirects:$1|/}.html [R=301,L,UnsafeAllow3F]