mercredi 22 septembre 2021

apache rewrite unknown query parameters are present

Apache striping all query parameters if an unknown query parameter is found. Is there a apache module that supports this or should we write a custom regex for this?

Working example: https://ss.project.com/?code=test

Failing example: https://ss.project.com/?code=test&unknown=dropped

Failed example returns https://ss.project.com/ as there is an unknown query parameter. Ideal should be drop unknow param but have know param https://ss.project.com/?code=test

PARAMS_WHITELISTED is list of all known query parameters

RewriteCond ?%{QUERY_STRING} [?&](?!(?:'${PARAMS_WHITELISTED}')(?=(?:=|&|$)))




Aucun commentaire:

Enregistrer un commentaire