diff --git a/server/controllers/common.js b/server/controllers/common.js index 3bcfcd940f..55cc4d333f 100644 --- a/server/controllers/common.js +++ b/server/controllers/common.js @@ -4,6 +4,7 @@ const pageHelper = require('../helpers/page') const _ = require('lodash') const CleanCSS = require('clean-css') const moment = require('moment') +const qs = require('querystring') /* global WIKI */ @@ -420,7 +421,8 @@ router.get('/*', async (req, res, next) => { if (isPage) { if (WIKI.config.lang.namespacing && !pageArgs.explicitLocale) { - return res.redirect(`/${pageArgs.locale}/${pageArgs.path}`) + const query = !_.isEmpty(req.query) ? `?${qs.stringify(req.query)}` : '' + return res.redirect(`/${pageArgs.locale}/${pageArgs.path}${query}`) } req.i18n.changeLanguage(pageArgs.locale)