For those that use www with writeon.io, of which there ARE FEW, I put a server redirect from www to root domain. However, I messed up. Below is the new code for 1.10.4:
/*
* FORCE HTTPS
*/
// Used to force SSL - required for security =============================
app.use('*', function(req, res, next) {
if(req.headers['x-forwarded-proto'] != 'https') {
return res.redirect('https://' + req.hostname + req.originalUrl);
}
else if (req.headers.host == 'www.writeon.io') {
return res.redirect('https://writeon.io' + req.originalUrl);
}
/\.(eot|ttf|woff|svg|png)$/.test(req.path) && res.header('Access-Control-Allow-Origin', '*');
return next();
});
However, for those FEW who did use www, redirect would not allows them to get their stories out of www and into root, so UGH I have to disable it. Effin frustrating.
For those that use www with writeon.io, of which there ARE FEW, I put a server redirect from www to root domain. However, I messed up. Below is the new code for 1.10.4:
However, for those FEW who did use www, redirect would not allows them to get their stories out of www and into root, so UGH I have to disable it. Effin frustrating.