<div dir="ltr">Yo don't need to escape the "!" if you delimit the URL with single quotes... <br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 7, 2015 at 11:28 AM, ramsoft75 <span dir="ltr"><<a href="mailto:nginx-forum@nginx.us" target="_blank">nginx-forum@nginx.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi there all and thank's for the help<br>
<br>
Dear oscaretu, the curl was tested with " doesn't help, because ! is a<br>
special character it needs a escaope after "\", so the correct curl command<br>
for the terminal is :<br>
<br>
$ curl -A iPad -i <a href="http://www.domain.com/#\!/pt/--item-view/en/3190/Wok" rel="noreferrer" target="_blank">http://www.domain.com/#\!/pt/--item-view/en/3190/Wok</a><br>
<br>
Dear Francis Daly<br>
<br>
For the initial configuration :<br>
<span class=""><br>
if ($http_user_agent ~* '(iPhone|iPod|iPad|Android|BlackBerry|webOS|Windows<br>
Phone)') {<br>
</span>           rewrite ^ <a href="http://m.domain.com/$request_uri" rel="noreferrer" target="_blank">http://m.domain.com/$request_uri</a>;<br>
    }<br>
<br>
<br>
For the example above the output in terminal is :<br>
<br>
HTTP/1.1 302 Moved Temporarily<br>
Server: nginx<br>
Date: Tue, 07 Jul 2015 09:19:47 GMT<br>
Content-Type: text/html<br>
Content-Length: 154<br>
Connection: keep-alive<br>
Location: <a href="http://m.domain.com//" rel="noreferrer" target="_blank">http://m.domain.com//</a><br>
<br>
<html><br>
<head><title>302 Found</title></head><br>
<body bgcolor="white"><br>
<center><h1>302 Found</h1></center><br>
<span class=""><hr><center>nginx</center><br>
</body><br>
</html><br>
<br>
</span>It's the same if i changed to :<br>
<span class=""><br>
    if ($http_user_agent ~*<br>
'(iPhone|iPod|iPad|Android|BlackBerry|webOS|Windows Phone)') {<br>
</span>           rewrite ^/$ <a href="http://m.domain.com/$request_uri" rel="noreferrer" target="_blank">http://m.domain.com/$request_uri</a>;<br>
    }<br>
<br>
The problem is not from Nginx but from Safari witch doesn't send the url<br>
after #, the Safari removes the fragment.<br>
<br>
There are some documentation about this in :<br>
<br>
<a href="http://randomproblems.com/parameter-passing-redirect-craziness-301-redirects-fragment-identifiers-hash-query-string-variables/" rel="noreferrer" target="_blank">http://randomproblems.com/parameter-passing-redirect-craziness-301-redirects-fragment-identifiers-hash-query-string-variables/</a><br>
<a href="http://news.qooxdoo.org/http-redirects-and-loss-of-fragment-identifiers" rel="noreferrer" target="_blank">http://news.qooxdoo.org/http-redirects-and-loss-of-fragment-identifiers</a><br>
<br>
The question know how to handle this # problem with Safari.<br>
<br>
Thank's for the help<br>
<br>
Posted at Nginx Forum: <a href="http://forum.nginx.org/read.php?2,260033,260110#msg-260110" rel="noreferrer" target="_blank">http://forum.nginx.org/read.php?2,260033,260110#msg-260110</a><br>
<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Oscar Fernandez Sierra<br><a href="mailto:oscaretu@gmail.com" target="_blank">oscaretu@gmail.com</a></div>
</div>