Authored by yyq

301 redirect

... ... @@ -24,6 +24,11 @@ exports.index = (req, res, next) => {
let resData = {};
let qs = '';
if (req.originalUrl && req.originalUrl.indexOf('.html') < 0 &&
!_.isEmpty(req.query)) {
return res.redirect(301, helpers.urlFormat(`${req.originalUrl}.html`));
}
try {
qs = decodeURIComponent(req._parsedOriginalUrl.query || '');
} catch (e) {
... ...