<div dir="ltr"><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">Hello,<br><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">Trying to rewrite an URI based on an argument, I cannot match it otherwise than by using rewrite.<br><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">The problem is I fail to achieve a working recipe rewriting<br><span style="font-family:courier new,monospace"><a href="http://example.com/watch?v=123456">example.com/watch?v=123456</a></span><br>to<br><span style="font-family:courier new,monospace"><a href="http://example.com/watch?vid=123456">example.com/watch?vid=123456</a></span><br><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"><span style="font-family:courier new,monospace">rewrite ^/watch\?v=(?<video>\d+)$ $scheme://$host$uri?vid=$video?</span><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">does not seem to work<br><br><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"><span style="font-family:courier new,monospace">rewrite ^/watch\? $scheme://$host$uri?vid=blah?</span><br></div></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">does not either<br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"><span style="font-family:courier new,monospace">rewrite ^/watch $scheme://$host$uri?vid=blah?;</span><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">works, though it explodes internal rewrites (which is not our concern here).<br><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">The question mark in the first recipe seems to wreak havoc.<br><ol><li>Is there any other mean to achieve such a redirection than using rewrite?</li><li>How to escape a question mark in a <span style="font-family:courier new,monospace">rewrite</span> mask, ince escaping perl-like does not seem to work?<br></li></ol></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">Thanks,</div><div><div class="gmail_signature"><font size="1"><span style="color:rgb(102,102,102)">---<br></span><b><span style="color:rgb(102,102,102)">B. R.</span></b><span style="color:rgb(102,102,102)"></span></font></div></div>
</div>