Pan resolution and second-level domain name redirection

Source: Internet
Author: User

Rye $ by) av0 implementation conditions:
Y' fe4 ~ 0x7hyce01, must have a top-level domain name, and this domain name must be wildcard resolution and point.
! S2fmt Vaj # a2q02, must have an independentWebServer. A wildcard domain name directs to the server. 51testing Software Testing Network | + tlqf (:}
3. Create a web site with an empty Host header name on the Web server.
(Jde 'd, csi04, Domain Name Redirection

What is wildcard domain name resolution? 51testing Software Testing Network (}'m-do, n ~] D
* .Abc.com under the customer's top-level domain name abc.com is resolved to the same IP address. For example, if B .abc.com is set, the user automatically resolves it to the same IP address as abc.com and displays the same page as abc.com.
Uqg + zx, [k | 0 aims to enable users to register abc.com as a virtual third-level domain name system with a suffix (also known as a free Domain Name ).

Implementation: 51testing software testing network 0lh b2yo. p v] 9A
Go to DNS
^ 3oa \ _ 0 open the domain for Pan resolution (abc.com) 51testing software testing network "[X # \ Q, F
Create a new domain name *
If \) BKF-]) Z '0 enter this domain to create an empty Host and only enter the server's ip51testing software testing network w * eyl8v _
OK ~! 51testing software testing network ye4w & pqpk77' ghh
51testing software testing network k9wr4g ^ L [} "za
After wildcard resolution is implemented, all access to * .abc.com will go to the specified Web server. What we need to do now is to redirect domain names.

<! -- # Include file = "Conn/Conn. asp" --> 51testing Software Testing Network) V0 @ XQ akq, \ y f3r
<% 51testing software testing network Y % [0o 'K; D' y-z
Turl = request. servervariables ("http_host") 'address of the Request page 51testing software testing network m-B2a/j9d
Durl = left (Turl, instr (Turl, ".")-1) 'second-level domain name
) Q "Ni W ^ t [7f llw0surl = durl &". "51testing I: Z ^ 0y U9 ^" v6n
Surl = Replace (Turl, "" & Surl & "", "") 'top-level domain name, that is, abc.com

If durl = "www" or durl = "" then51testing software testing network-M: Q @ uwtxne "m
Response. Redirect ("default homepage") 51testing software testing network _ m # X [& \ (m1m
Response. End ()
I8i au9k5f9g "x0else51testing Software Testing Network: n1olu0v_u ~
Set rs = conn.exe cute ("select ID, username from [register] Where username = '" & durl & "'") 51testing 5z7k? Qo5dbw
If Rs. EOF and Rs. bof then51testing software testing network my6 'i2x6w8 | EP
Response. Redirect ("default homepage") 51testing software testing network 7 {. Hu + ZF
Response. End ()
U, boox. Shh KC: I0 else
2 T $ ds, C9 'P ^ 0 url = "" 'HereThe URL is the second-level domain name access path.51testing software testing network! B p-I/^ 9? Q
Rs. close51testing software testing network 7xy2 @ +} p q9e
Set rs = nothing51testing software testing network U9? # Lxr6 ~ 5 {e "xx
%>

L8jqdo6t "n1_0 <HTML>
F6d ?, Q + Q! K8k0 ; Htyyf1j % F0 <meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
# K * obs | ~ 0 <meta content = "text/html; charset = UTF-8" HTTP-EQUIV = "Content-Type">
6 p + BM # ^ c4c. {P; R. y g. n5g0 <title> </title> 51testing software testing network} C: m tu "VW} # Y
</Head> 51testing software testing network 9z6 ~ -Q \ + O B
<Frameset frameborder = "0" framespacing = "0" scrolling = "no" border = "0" marginheight = "0" marginwidth = "0" rows = "0, * "> 51testing software testing network 1tk! [Rib} 4o4av
<Frame scrolling = "no" noresize = "0" marginwidth = "0" marginheight = "0" framespacing = "0" frameborder = "0" target = "Main" name =" main1 "src =" about: blank ">

<Frame scrolling = "yes" noresize = "0" marginwidth = "0" marginheight = "0" framespacing = "0" frameborder = "0" target = "main1" name =" main1 "src =" <% = URL %> ">

<Noframes>
0qv! W8tx 'j0 <body>
1B # ZD) Q ~) C7v0 <p> This page uses frames, but your browser doesn't support them. </P> </body> 51testing Software Testing Network: MD $] 0 wldq & D
</Noframes>
^ Kc2a &? {6 s? X) M0 </frameset>
F "| N/_ }~ J0 Q-U0s # RJ * H/c1s0 <%
T0b t 'cud0 end if51testing software testing network znyd + | d' U/F $ s
End if 51testing software testing network L x: _ WBO
%>
T9wX-Q0 @ % S | 0
& _ VM (| N0 Save the above Code as index. asp on the default site of the Web server.

The key point is the use of the frameset framework, so that the address bar always displays the second-level domain name address.

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.