これは Gatekeeper のバージョンです。これを自分の Web サイトのサブドメインに移動させようとしていますが、メイン ドメインの特定のファイルにしか移動しません。基本的に、404 を入力すると、 http: //mysite.com/404.htmlに移動します。http:// subdomain .mysite.com/404.htmlに移動します。私は変わる必要があると思う
if (パスワード) { this.location.href = パスワード + ".html"; }
this.location.href が現在の URL を読み取らず、特に必要な URL を読み取る場所。
完全なサンプルコードは次のとおりです。
<HTML>
<HTML>
<HEAD>
<TITLE>My Page</TITLE>
<SCRIPT language="JavaScript"><!--
/*********************************************************
GateKeeper v2.3 - by Joe Barta
http://www.pagetutor.com/keeper/
Permission is granted to freely use this script.
**********************************************************/
function GateKeeper() {
var password = prompt("Password required:", "");
if (password) { this.location.href = password + ".html"; }}
//--></SCRIPT>
</HEAD>
<BODY>
<A HREF="javascript:{;}" onClick="GateKeeper(); return false">Click here</A> for my secret page!
</BODY>
</HTML>
アイデアや提案はありますか?前もって感謝します!