I\'m trying to reroute http (80)
to https (443)
in my express app. I\'m using some middle ware to do this. If i go to my https://my-example-
I'm using a similar solution, where I also prepend 'www' because our SSL certificate is not valid without it. Works fine in every browser, but Firefox. Any idea?
http.createServer(function(req, res) {
res.writeHead(301, {
Location: "https://www." + req.headers["host"].replace("www.", "") + req.url
});
res.end();
}).listen(80);