if (window.location.href.endsWith("pt")) {
    window.location.href = window.location.href + "/index.html";
}
else {
    document.write("<Your 403 error message here>");
}