feat: redirect root page / to /index page

This commit is contained in:
TallTechDude
2022-02-07 07:27:50 +00:00
parent 46ccda6248
commit 6004bc27e7

View File

@ -872,11 +872,14 @@ int HTTP_ProcessPacket(const char *recvbuf, char *outbuf, int outBufSize, http_s
strcat(outbuf,htmlReturnToMenu);
HTTP_AddBuildFooter(outbuf,outBufSize);
strcat(outbuf,htmlEnd);
} else if(http_checkUrlBase(urlStr,"")) {
// Redirect / to /index page
strcat(outbuf,"HTTP/1.1 302 OK\nLocation: /index\nConnection: close\n\n");
} else {
http_setup(outbuf, httpMimeTypeHTML);
strcat(outbuf,htmlHeader);
strcat_safe(outbuf,g_header,outBufSize);
strcat(outbuf,"Not found.");
strcat(outbuf,"Not found.<br>\n");
strcat(outbuf,htmlReturnToMenu);
HTTP_AddBuildFooter(outbuf,outBufSize);
strcat(outbuf,htmlEnd);