redirect for trailing slash urls in NGINX

location ~ ^([^.\?]*[^/])$ {
try_files $uri @addslash;
}

location @addslash {
return 301 $uri/;
}

location / {
try_files $uri $uri/ /index.php$is_args$args;
}

Add your comment