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');
99
1010module . exports = withBundleAnalyzer ( {
1111 i18n,
12+ trailingSlash : false ,
1213 reactStrictMode : false ,
1314 compress : true , // 启用压缩
1415 eslint : {
Original file line number Diff line number Diff line change @@ -71,13 +71,12 @@ async function startServer() {
7171
7272 req . locale = locale ;
7373
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+ // }
8180
8281 next ( ) ;
8382 }
You can’t perform that action at this time.
0 commit comments