1
I'm attempting to rewrite a URL based on the Accept header of the request. I saw in the docs that this seems to be possible, but I couldn't find any details or examples anywhere on how to go about it.
Basically I'd like requests to /abc/index.html
be rewritten according to the Accept header:
Requests with Accept: application/vnd.x.v1+json
to be rewritten as /v1/abc/index.html
Requests with Accept: application/vnd.x.v2+json
to be rewritten as /v2/abc/index.html
and so forth. And requests with the generic application/json
Accept header or no Accept header at all to be rewritten as /v5/abc/index.html
Any pointers on who I could accomplish this are greatly appreciated!
Thanks!
This worked perfectly! I'll study your example to learn this and derive other uses. Thank you!! – Edy Bourne – 2014-12-31T15:12:52.700