loveboatexpress
asked on
http redirect depending on URL / Domain / Location of htm file
this is a very similar question to:
https://www.experts-exchange.com/questions/21623909/conditional-http-redirect-depending-on-URL-Domain.html
However in this situation, the page might be accessed by unc path or mapped drive.
X:\company\intranet\index. htm
This is fine, but I would like to redirect the browser to:
https://alias.domain.tld/folder/index.htm
where folder is a virtual directory of an SSL enabled webserver that points back to X:\company\website\
This doesn't work, but the concept is correct:
if (window.location.hostname != "https://alias.domain.tld/folder/index.htm")
{
window.location.replace(wi ndow.locat ion.href.r eplace(win dow.locati on.hostnam e, "https://alias.domain.tld/folder/index.htm"));
}
https://www.experts-exchange.com/questions/21623909/conditional-http-redirect-depending-on-URL-Domain.html
However in this situation, the page might be accessed by unc path or mapped drive.
X:\company\intranet\index.
This is fine, but I would like to redirect the browser to:
https://alias.domain.tld/folder/index.htm
where folder is a virtual directory of an SSL enabled webserver that points back to X:\company\website\
This doesn't work, but the concept is correct:
if (window.location.hostname != "https://alias.domain.tld/folder/index.htm")
{
window.location.replace(wi
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER