Showing
1 changed file
with
2 additions
and
2 deletions
@@ -12,8 +12,8 @@ module.exports = () => { | @@ -12,8 +12,8 @@ module.exports = () => { | ||
12 | guangReg = /^\/guang/, | 12 | guangReg = /^\/guang/, |
13 | guangDetailReg = /.html$/; | 13 | guangDetailReg = /.html$/; |
14 | 14 | ||
15 | - if (req.subdomains.length > 1) { | ||
16 | - res.redirect(helpers.urlFormat(req.path, req.query, req.subdomains[0])); | 15 | + if (req.subdomains.length > 1 && req.subdomains[1] === 'www') { |
16 | + res.redirect(301, helpers.urlFormat(req.path, req.query, req.subdomains[0])); | ||
17 | } | 17 | } |
18 | if (req.subdomains.length) { | 18 | if (req.subdomains.length) { |
19 | switch (req.subdomains[0]) { | 19 | switch (req.subdomains[0]) { |
-
Please register or login to post a comment