Currently I have a main redirect to the home of my webserver. However I would like to treat the subpaths with redirect after a 404 was not for the home and yes for the subpath, that with multiple subpaths. That not to repeat the rules, I must deal with a REGEX, however I don't know how to insert these rules and return to the current subpath.
home
www.foo.com.br
subpath
www.foo.com.br/machine
www.foo.com.br/cloud
www.foo.com.br/air
today
# define error page
error_page 404 = @notfound;
# error page location redirect 301
location @notfound {
return 301 /;
}
would like answer 404
www.foo.com.br/machine/test123
go to
www.foo.com.br/machine/