<div dir="ltr">Hi Francis,<div><br></div><div>Thanks for your input. What would be the best ways doing it then ?</div><div>(I forgot to mention there is a large amount of URLs : +/- 20)</div><div><br></div><div>Is this a good way ? :</div><div><br></div><div><div>map $old $new {</div><div> oldlink.html <a href="http://newlink.com">newlink.com</a></div><div> oldink2.html newlink2.html </div><div>}</div><div> </div><div>location $old {</div><div> return 301 $scheme://$host$new;</div><div>}</div></div><div><br></div><div>If not, could you show me an example ?</div><div><br></div><div>Thanks in advance</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-02-14 23:22 GMT+01:00 Francis Daly <span dir="ltr"><<a href="mailto:francis@daoine.org" target="_blank">francis@daoine.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sat, Feb 14, 2015 at 10:57:26PM +0100, JACK LINKERS wrote:<br>
<br>
> But how do I redirect URLs that have been changed ?<br>
> ie. <a href="https://mywebsite.com/oldname.html" target="_blank">https://mywebsite.com/oldname.html</a> to <a href="https://mywebsite.com/newname.html" target="_blank">https://mywebsite.com/newname.html</a><br>
<br>
</span>location = /oldname.html { return 301 /newname.html; }<br>
<span class=""><br>
> I did try<br>
><br>
> if ( $request_filename ~ oldname.html/ ) {<br>
> rewrite ^ <a href="https://mywebsite.com/newname.html/" target="_blank">https://mywebsite.com/newname.html/</a>? permanent;<br>
> }<br>
><br>
> But this doesn't work.<br>
<br>
</span>Yes, it does. If your incoming request matches the string "oldname.html/".<br>
<br>
It just isn't a very good way of implementing it.<br>
<span class="HOEnZb"><font color="#888888"><br>
f<br>
--<br>
Francis Daly <a href="mailto:francis@daoine.org">francis@daoine.org</a><br>
<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" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</font></span></blockquote></div><br></div>