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;
|
bool redir = true;
|
||||||
if (!noRedirect) {
|
if (!noRedirect) {
|
||||||
if (host == "necronda.net") {
|
if (getWebRoot(host).empty()) {
|
||||||
req.redirect(303, "https://www.necronda.net/");
|
req.redirect(303, "https://www.necronda.net" + req.getPath());
|
||||||
} else if (socket->getSocketPort() != 443) {
|
} else if (socket->getSocketPort() != 443) {
|
||||||
req.redirect(303, "https://" + host + req.getPath());
|
req.redirect(303, "https://" + host + req.getPath());
|
||||||
} else if (getWebRoot(host).empty()) {
|
|
||||||
req.redirect(303, "https://www.necronda.net" + req.getPath());
|
|
||||||
} else {
|
} else {
|
||||||
redir = false;
|
redir = false;
|
||||||
}
|
}
|
||||||
|
@ -195,7 +195,7 @@ string getWebRoot(string host) {
|
|||||||
if (fileExists(root)) {
|
if (fileExists(root)) {
|
||||||
return root;
|
return root;
|
||||||
} else {
|
} else {
|
||||||
return "/";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user