The same space to bind a domain name more
Copy Code code as follows:
Checkdomain
Sub Checkdomain ()
Dim Sdomain
Sdomain = Request.ServerVariables ("Http_host")
If Instr (Sdomain, "a.xxx.com") >0 then Response.Redirect "A/"
End Sub
%>
Two more domains in the same space
Copy Code code as follows:
Checkdomain
Verification of e-mail addresses
Php/*Verify Email address*/function Checkmail ($email) {//user name, by "\w" format character, "-" or "." Composition$email _name="\w| (\w[-.\w]*\w)";//The first paragraph in the domain name, similar to the rule and user name, does not include the dot number "."$code _at="@"; $per _domain="\w| (\w[-\w]*\w)";//the middle part of the domain name, up to two paragraphs$mid _domain="(\.". $per _domain.") {0,2}";//The last paragraph of a domain name can only be ".
item IP address, and click Edit or add to add a new binding. The host header value is blank.
The following code is used to obtain and determine the Host Header. The code is placed in Index. aspx. cs, the first file of the default document.
Code:/// /// Obtain the second-level domain host header value and perform redirection/// Public void CheckDomain (){HostName = HttpContext. Current. Request. Url. Host. ToString (); // obtain the URL Host addressU
ASP tutorials. NET pseudo-static implementation and two-level domain name Universal parsing
App.context.rewritepath (Path, String.Empty, Strb.tostring (). Split ('? ') [1]);In Web.config configuration:
When you finally set up IIS, remember to set the table header for IIS to NULL.Run it, and you'll be able to achieve it.
HttpApplication app = (HttpApplication) sender;
HttpContext context = App.context;
string url = Context.request.url.absoluteuri; Full URL
String turl = U
click Properties. Click the Advanced button of the website item IP address, and click Edit or add to add a new binding. The host header value is blank.
The following code is used to obtain and determine the Host Header. The code is placed in Index. aspx. cs, the first file of the default document.
Code:
Reference content is as follows:/// /// Obtain the second-level domain host header value and perform redirection/// Public void CheckDomain
Set the default access document of this site to Index. aspx ,.
After completion, No matter what level-2 prefix is used, the website will be accessed.
The following code is used to obtain and determine the Host Header. The code is placed in Index. aspx. cs, the first file of the default document.
/// /// Obtain the second-level domain host header value and perform redirection/// Public void CheckDomain (){HostName = HttpContext. Current. Request. Url.
-IIS6)Open IIS, right-click the site, and then properties, click on the Advanced button of the site item IP address, then edit or add the new binding, the host header value is empty.
Below to obtain the URL address for analysis, the following is the procedure code, used to obtain and determine the host header, the code is placed in the default document in the first file Index.aspx.cs
Code: /// ///get two domain host header value and implement turn to /// public void
site, and click Properties. Click the Advanced button of the website item IP address, and click Edit or add to add a new binding. The host header value is blank.
The following code is used to obtain and determine the Host Header. The code is placed in index. aspx. CS, the first file of the default document.
Code:/// /// Obtain the second-level domain host header value and perform redirection/// Public void checkdomain (){Hostname = httpcontext. Curr
resolved to your server IP
Method 1: second-level domain name URL redirectionA. Create a site and bind a domain name (win2003-IIS6) to IIS)Open IIS, right-click the site, and click Properties. Click the Advanced button of the website item IP address, and click Edit or add to add a new binding. The host header value is blank.
The following describes how to obtain the URL for analysis.CodeTo obtain and determine the Host Header. The code is placed in index. aspx. CS, the first file of the defa
record resolved to your server IP
Method 1: second-level domain name URL redirectionA. Create a site and bind a domain name (win2003-IIS6) to IIS)Open IIS, right-click the site, and click Properties. Click the Advanced button of the website item IP address, and click Edit or add to add a new binding. The host header value is blank, as shown in:
You only need to bind one, as shown in the following figure:
Set the default access document of this site to index. aspx ,.
After completi
function Checkdomain () {var domain = document.getElementById ("domain"). Value;if (domain = = ") {Alert ("Please fill in the domain name!") ");document.getElementById ("domain"). focus ();return false;}var info=domain.match (/^[a-z0-9]+$/);if (!info) {Alert ("Domain name must be composed of letters and numbers!") ");document.getElementById ("domain"). focus ();return false;}else{var xml=window.activexobject? New ActiveXObject ("Microsoft.XMLHTTP"): N
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.