Quantcast
Channel: Nginx Forum - Nginx Mailing List - English
Viewing all articles
Browse latest Browse all 7229

URI rewriting based on arguments (no replies)

$
0
0
Hello,

Trying to rewrite an URI based on an argument, I cannot match it otherwise
than by using rewrite.

The problem is I fail to achieve a working recipe rewriting
example.com/watch?v=123456
to
example.com/watch?vid=123456

rewrite ^/watch\?v=(?<video>\d+)$ $scheme://$host$uri?vid=$video?
does not seem to work

rewrite ^/watch\? $scheme://$host$uri?vid=blah?
does not either

rewrite ^/watch $scheme://$host$uri?vid=blah?;
works, though it explodes internal rewrites (which is not our concern here)..

The question mark in the first recipe seems to wreak havoc.

1. Is there any other mean to achieve such a redirection than using
rewrite?
2. How to escape a question mark in a rewrite mask, ince escaping
perl-like does not seem to work?

​Thanks,​
---
*B. R.*
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Viewing all articles
Browse latest Browse all 7229

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>