File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ const { i18n } = require('./next-i18next.config');
9
9
10
10
module . exports = withBundleAnalyzer ( {
11
11
i18n,
12
+ trailingSlash : false ,
12
13
reactStrictMode : false ,
13
14
compress : true , // 启用压缩
14
15
eslint : {
Original file line number Diff line number Diff line change @@ -71,13 +71,12 @@ async function startServer() {
71
71
72
72
req . locale = locale ;
73
73
74
- // 处理尾部斜杠并重定向
75
- if ( req . url . length > 1 && req . url . endsWith ( '/' ) ) {
76
- const newUrl =
77
- req . url . slice ( 0 , - 1 ) +
78
- ( req . url . includes ( '?' ) ? req . url . slice ( req . url . indexOf ( '?' ) ) : '' ) ;
79
- return res . redirect ( 301 , newUrl ) ;
80
- }
74
+ // // 处理尾部斜杠并重定向
75
+ // if (req.url.length > 1 && req.path.endsWith('/')) {
76
+ // const newUrl =
77
+ // req.path.slice(0, -1) + req.params
78
+ // return res.redirect(301, newUrl);
79
+ // }
81
80
82
81
next ( ) ;
83
82
}
You can’t perform that action at this time.
0 commit comments