diff --git a/app.js b/app.js index f0223b9..3eb1e35 100644 --- a/app.js +++ b/app.js @@ -29,12 +29,23 @@ app.use(express.static(__dirname + '/build')); // Lets try and slow down some of those exploit crawlers app.use("/", require('./filterRoutes')); +// Handle some iOS icon 404s +app.get("/apple-touch-icon*", function(req, res) { + res.sendFile(__dirname + '/build/images/favico/' + req.url, () => { + res.sendFile(__dirname + '/build/images/favico/apple-touch-icon.png'); + }); +}); + +app.get("/favicon.png", function(req, res) { + res.sendFile(__dirname + '/build/images/favico/apple-touch-icon.png'); +}); + app.get("/robots.txt", function(req, res) { res.send("User-agent: * Disallow: "); }) -app.get(/\/(feed|rss)\/?$/, function(req, res) { - res.redirect('/feed.xml'); +app.get(/(\/(feeds?|rss|atom)\/?|feed.xml|rss.xml|index.rss|feed.rss)$/, function(req, res) { + res.redirect(301, '/feed.xml'); }) app.get("/healthz", function(req, res) { diff --git a/src/images/favico/apple-touch-icon-precomposed.png b/src/images/favico/apple-touch-icon-precomposed.png new file mode 100644 index 0000000..0b7df6e Binary files /dev/null and b/src/images/favico/apple-touch-icon-precomposed.png differ diff --git a/src/images/favico/apple-touch-icon.png b/src/images/favico/apple-touch-icon.png new file mode 100644 index 0000000..0b7df6e Binary files /dev/null and b/src/images/favico/apple-touch-icon.png differ diff --git a/templates/partials/head.html b/templates/partials/head.html index 966ff36..81de46b 100644 --- a/templates/partials/head.html +++ b/templates/partials/head.html @@ -18,6 +18,7 @@ +