This commit is contained in:
Tom Moor
2017-05-27 11:22:42 -07:00
parent 639a0ec45c
commit 044486b9a6
4 changed files with 8 additions and 21 deletions

View File

@@ -1,7 +1,7 @@
export default function subdomainRedirect(options) {
return async function subdomainRedirectMiddleware(ctx, next) {
if (ctx.headers.host === 'beautifulatlas.com') {
ctx.redirect('https://www.' + ctx.headers.host + ctx.path);
ctx.redirect(`https://www.${ctx.headers.host}${ctx.path}`);
} else {
return next();
}