Redirects
This commit is contained in:
@ -192,12 +192,10 @@ bool connection_handler(const char *preprefix, const char *col1, const char *col
|
||||
|
||||
bool redir = true;
|
||||
if (!noRedirect) {
|
||||
if (host == "necronda.net") {
|
||||
req.redirect(303, "https://www.necronda.net/");
|
||||
if (getWebRoot(host).empty()) {
|
||||
req.redirect(303, "https://www.necronda.net" + req.getPath());
|
||||
} else if (socket->getSocketPort() != 443) {
|
||||
req.redirect(303, "https://" + host + req.getPath());
|
||||
} else if (getWebRoot(host).empty()) {
|
||||
req.redirect(303, "https://www.necronda.net" + req.getPath());
|
||||
} else {
|
||||
redir = false;
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ string getWebRoot(string host) {
|
||||
if (fileExists(root)) {
|
||||
return root;
|
||||
} else {
|
||||
return "/";
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user