For custom redirects, Ghost currently overwrites query params in to url as they are in from. This means if to url has any query params, they will get overridden to be empty instead if from url has no query params. This is leading to unexpected behavior, specially in cases where to url has explicit query params. Suggested update to behavior -
from and to query params, with from overwriting tofromThis covers _most_ scenarios in which query params override can be used.
This issue also applies to a redirect like this:
[{
"from": "^/media/(.*)$",
"to": "https://storage.googleapis.com/files.domain.com/media/$1",
"permanent": true
}]
In this case the URL works, but not for the $1 part, which is what I would expect and also our docs are describing.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Is there any workaround for this?
Hey @Louvki o/
No workaround that I'm aware of I'm afraid!
We'd welcome a PR if you find the time :ghost:
@Louvki 馃憢, if you create a topic on our forum I might be able to help you with a workaround https://forum.ghost.org
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hello, @stale. I'm working on this.
to take precedence. URL query params pass through => #12333.from field.
Most helpful comment