Welcome! Log In Create A New Profile

Advanced

Re: 301 redirect with custom content problem

Robert Mueller
December 04, 2012 12:30AM
> This way you'll end up with two 301 redirects due to rewrite being
> executed again for /foo/bar/301.html.

Ah right, makes sense.

> Try this instead:
>
> server {
> listen 80 default;
>
> location / {
> error_page 301 /foo/bar/301.html;
> return 301 "https://example.com$request_uri";
> }
>
> location = /foo/bar/301.html {
> # static
> }
> }

Great, that worked, thanks.

Rob

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

301 redirect with custom content problem

Robert Mueller November 29, 2012 08:54PM

Re: 301 redirect with custom content problem

Maxim Dounin November 30, 2012 02:44AM

Re: 301 redirect with custom content problem

Robert Mueller December 04, 2012 12:30AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 52
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready