On Sat, Feb 14, 2015 at 10:57:26PM +0100, JACK LINKERS wrote:

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

location = /oldname.html { return 301 /newname.html; }

> I did try
> 
>    if ( $request_filename ~ oldname.html/ ) {
>       rewrite ^ https://mywebsite.com/newname.html/? permanent;
>    }
> 
> But this doesn't work.

Yes, it does. If your incoming request matches the string "oldname.html/".

It just isn't a very good way of implementing it.

        f
-- 
Francis Daly        [email protected]

_______________________________________________
nginx mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to