Implement unlimited second-level domain name redirection through simple front-end code (from carefree Biyuan)

Source: Internet
Author: User

As long as the space supports wildcard domain name resolution, there is no need for the server script language or DNS, you can use the front-end code to construct an unlimited second-level domain name:

<HTML>
<Head>
<Title> Biyuan free second-level domain name </title>
<Head>
</Head>
<Body>
<SCR limit PT Language = "Limit Cr limit PT">
<! --
// Global variable
VaR curl = "http://www2.17389.com/" // the site or directory that redirects when processing fails
VaR url = "17389"; // keyword of the top-level domain name, which is www.17389.com
VaR Surl = location. href; // obtain the address entered by the current user
VaR ourl = (Surl. Split (".") [0]). Split ("//") [1]); // splits the address obtained by the user
VaR xurl = false; // create a global variable to determine whether the record set exists.

// User information
VaR user = new array ();
User [0] = new array ("Biyuan", "http://aoao.52ui.com/biyuan/", "Biyuan online ");
User [1] = new array ("fhonline", "http://www.17389.com", "Feihong network ");
User [2] = new array ("51js", "http://www.51js.com/", "Carefree script ");
User [3] = new array ("ucren", "http://www.ucren.com/", "gamer ");
User [4] = new array ("aoao", "http://aoao.52ui.com/", "Carefree ");

// Determine the validity of the top-level domain name
If (Surl. Split (".") [1]! = URL ){
Location. href = curl;
}

// Match the data and execute the jump
Else {
For (var j = 0; j <user. length; j ++ ){
If (ourl = user [J] [0]) {
Document. Write ("loading" + User [J] [2] + ", please wait..."); // the information displayed during redirect
Document. Title = user [J] [2]; // information of the title bar during redirect
Xurl = user [J] [1]; // assign a value to the global variable
SetTimeout ("location. href = xurl", 5000); // jump after 5 seconds
}
}
}

// The error message is not displayed.
If (! Xurl ){
Document. Write ("this domain name cannot be found. After 10 seconds, jump to the <a href = '" + curl + "'> Biyuan Network </a> ");
SetTimeout ("location. href = curl", 10000 );
}

// -->
</Scr platinum Pt>
</Body>
</Html>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.