Authored by 周少峰

redirect

... ... @@ -4,6 +4,7 @@
* @date: 2016/6/16
*/
'use strict';
const helpers = global.yoho.helpers;
module.exports = () => {
return (req, res, next) => {
... ... @@ -11,6 +12,9 @@ module.exports = () => {
guangReg = /^\/guang/,
guangDetailReg = /.html$/;
if (req.subdomains.length > 1) {
res.redirect(helpers.urlFormat(req.path, req.query, req.subdomains[0]));
}
if (req.subdomains.length) {
switch (req.subdomains[0]) {
case 'www': // 主站
... ...