Nginx Rewrite rule to replace '?' with %3f
You should url-encode your query string to escape special characters such as ?
and =
Specifically, the name of your file you have to request for, once encoded, is this:
foo%3Flang%3Dar.html
In Javascript you can url-encode the filename with encodeURIComponent()
function, in PHP you have urlencode()
.