Allow the extra path to be ignored when redirecting #2298
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #2265
Add a new
REDIRECT_EXTRA_PATH_MODE
option to have more granularity when it comes to matching short URLs with extra path.Up until now it was possible to set
REDIRECT_APPEND_EXTRA_PATH
with values true or false. When true, short URLs would only match if the visited path was exactly the short code or custom slug of a URL. When false, they would match as long as they started with the short code or custom slug, and the rest of the path would be appended to the long URL before redirecting.The new option replaces this one by providing extra path modes:
default
: Same as settingREDIRECT_APPEND_EXTRA_PATH
to false.append
: Same as settingREDIRECT_APPEND_EXTRA_PATH
to true.ignore
: Will match short URLs using the same logic asappend
, but the extra path will be discarded instead.With this PR
REDIRECT_APPEND_EXTRA_PATH
becomes deprecated and marked for removal in Shlink 5.0.0