Some time ago, a friend asked me the question of implementing a dynamic two-level domain name under ASP. Talked to him about some of the solutions, which are summarized here for reference.I believe we all found similar to 58 of the same city site,
Everyone should know that Microsoft's urlrewrite can rewrite the URL, but also can only rewrite the part of the domain name after, rather than rewrite the domain name, such as: can rewrite the http://www.abc.com/1234/ to http://www.abc.com/show.aspx?
Brief Review:
Modification of Microsoft's urlrewrite can rewrite the URL. Here, the domain name must be rewritten to implement
Http://1234.abc.com/To
Http://www.abc.com/show.aspx? Id = 1234.
Step: 1. Your Domain Name
Http://www.abc.com/Is pan-parsed,
Sub Filtersitedomain () Dim Siteurl As String Dim Sitedomain As String Dim Sitemaindomain As String Siteurl = " Http://www.baidu.com/a/ B /index.html " ' Get URL Domain Name Sitedomain = getsitebyurl (siteurl) Msgbox Sitedomain '
function | file name
#region get the function of domain name, directory, file name in the URL
public string Geturldomainname (string strhtmlpagepath){String p = @ "http://[^\.] *\. (? [^/]*) ";Regex reg = new regex (p,regexoptions.ignorecase);Match
Reprinted: http://blog.csdn.net/seawave/article/details/1520988
After reading several pages of mastering regular expression, I tried to write a regular expression that could match the IP string. I did not write a few lines of code to determine
Brief Review:Modifying Microsoft's urlrewrite can rewrite the URL, where the domain name needs to be rewritten to implement http://1234.abc.com/to http://www.abc.com/show.aspx? Id = 1234.Step: 1. Your domain name http://www.abc.com/is pan-resolved,
Basic Ideas:1. Domain Name supports wildcard resolution, that is, resolve A record *. Domain Name. com to the server IP address, bind it to the server IIS, and the Host header is blank when binding;2. to implement a complete second-level domain,
Get the domain name of the URL in Java or IP and port get IP and domain name method one, use regular expressionsPublicstatic string GetIP (string url) {Filter using regular expressions, String re =((HTTP|FTP|HTTPS)://) (([a-za-z0-9._-]+) | ( [0-9] {1
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.