Hello,

I need to redirect some URLs after redesigning my website.
I use a 301 redirect for HTTP to HTTPS protocole :

if ($scheme = "http") {
return 301 https://$server_name$request_uri;
}

But how do I redirect URLs that have been changed ?
ie. https://mywebsite.com/oldname.html to https://mywebsite.com/newname.html

I did try

   if ( $request_filename ~ oldname.html/ ) {
      rewrite ^ https://mywebsite.com/newname.html/? permanent;
   }

But this doesn't work.

My website is hosted on a server with Direct Admin runing on a CentOS with
Nginx as webserver. Don't know if it helps.

Thanks in advance for help
_______________________________________________
nginx mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to