Skip to content

Commit 3ec2bdd

Browse files
committed
[Improved] Updated nginx app config to only remove trailing slash if it isn't a directory
1 parent 07d58db commit 3ec2bdd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

nginx.app.conf

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ location ~ /\. {
66
}
77

88
# 301 Redirect URLs with trailing /'s as per https://webmasters.googleblog.com/2010/04/to-slash-or-not-to-slash.html
9-
rewrite ^/(.*)/$ /$1 permanent;
9+
if (!-d $request_filename) {
10+
rewrite ^/(.*)/$ /$1 permanent;
11+
}
1012

1113
# Change // -> / for all URLs, so it works for our php location block, too
1214
merge_slashes off;

0 commit comments

Comments
 (0)