Hi Netlify team,
One of our “Redirect” use case is to redirect, if the query string matches a specific value.
Currently, this kind of redirect is achieved via .htaccess file in Apache.
The following is an example from Apache’s .htacecess file:
RewriteCond %{QUERY_STRING} ^partnerid=part02324$ [NC]
RewriteRule ^/?$ https://www.mydomain.com/partner?partnerid=part02324 [R=302,L]
In above, we are redirecting to a different path, if the query string has a specific parameter (partnerid=part02324). The [NC] in the above redirect stands for case insensitive search. R is status and L is last condition.
Could we have something similar in _redirects file. Unfortunately, I could not find any RegEx/Case sensitivity flag in the _Redirects documentation.
My Findings:
I believe “Edge Listeners” can be utilized for parameter checking. Requested for Edge Listeners (since its in early access).
[[redirects]]
from = “/partner”
to = “/home”
status = 200
force = false
query = {partnerid = “:partnerid”} # apply this rule for /?path=example
#conditions = {partnerid = “admin”} # NOT supported, wish list…
edge_handler = “verifyParamAndRedirect”
Without case insensitivity flag, it is going to be a pain, if we have to handle all the possible case matching for parameter “partnerid”. Case Insensitive flag support would be greatly appreciated.