<div dir="ltr"><span style="font-size:12.8000001907349px">Hello,</span><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">I need to redirect some URLs after redesigning my website.</div><div style="font-size:12.8000001907349px">I use a 301 redirect for HTTP to HTTPS protocole :</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px"><div><span style="white-space:pre-wrap">   </span>if ($scheme = "http") {</div><div><span style="white-space:pre-wrap">                </span>return 301 https://$server_name$request_uri;</div><div><span style="white-space:pre-wrap">     </span>}</div></div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">But how do I redirect URLs that have been changed ?</div><div style="font-size:12.8000001907349px">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></div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">I did try </div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px"><div>   if ( $request_filename ~ oldname.html/ ) {</div><div>      rewrite ^ <a href="https://mywebsite.com/newname.html/" target="_blank">https://mywebsite.com/newname.html/</a>? permanent;</div><div>   }</div></div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">But this doesn't work.</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">My website is hosted on a server with Direct Admin runing on a CentOS with Nginx as webserver. Don't know if it helps.</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">Thanks in advance for help</div></div>