mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 14:03:48 +03:00
c5b8dab523
no-issue This issue only occurs when using custom redirects with a subdirectory setup, and the path to be redirected from is expressed as a regex, and the url that is being redirected to is not an external url. The issue has a few components: - Redirect paths as a regex generally use the ^ to ensure that they match the beginning of the path. - The path that the regex is matched against conditionally excludes the subdirectory, specifically, the subdirectory is excluded for external urls These combined means you end up with a regex like /^\/custom-redirect/ and a path like /subdir/custom-redirect, these will not match/replace correctly, and you'll end in an infinite redirect loop. The fix here is to *always* remove the subdirectory when testing regex's and then conditionally adding it back *only* for the redirect, and only if it is an internal redirect |
||
---|---|---|
.. | ||
redirects.json |