From 117141c6250862a0c62695e846daac3df362d873 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sun, 18 Feb 2018 11:29:57 +0100 Subject: Redirect to index.html instead of serving directly --- webserver.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webserver.js b/webserver.js index 549aebd..554dc03 100755 --- a/webserver.js +++ b/webserver.js @@ -107,7 +107,7 @@ function requestFile(req,res,listdirs,path){ .replace("[/*LISTINGLISTING*/]",JSON.stringify(items)) ); } else if(stats.isDirectory()&&fs.readdirSync(fname).indexOf("index.html")!=-1){ - res.sendFile(node_path.join(fname,"index.html")); + res.redirect(301, node_path.join(fname,"index.html")); } else { res.status(404).send("That file does not exist."); return; -- cgit v1.2.3-70-g09d2