How to Develop a. NET system that supports second-level domain names on the local machine

Source: Internet
Author: User

Nowadays, more and more websites provide second-level domain name access, which is a good experience for users themselves. We believe that users will like it if they can adopt personalized domain names.

Because the development of the second-level domain name system involves the domain name itself, if the second-level domain name system is developed on the local machine without access through the Internet, it becomes a problem. This article describes how to achieve this easily.

  1. First, we find a file in the system: \ windows \ system32 \ drivers \ etc \ hosts, and add some domain name-related IP points to it with notepad. For example: 127.0.0.1 smartyouth.net, 127.0.0.1 jasper.smartyouth.net, 127.0.0.1 admin.smartyouth.net. After saving it, we can access the above URL and it will be set to the local machine, just like accessing localhost.
  2. In the Asp.net system, addCodeGenerally, you can analyze the second-level domain name in default. aspx and use server. Transfer to go to the actual page.
  3. In the login code, process the login cookie and set the domain of the cookie to .smartyouth.net.
  4. In the logout code, clear the logon cookie.

For more information about the second-level domain cookie, see section 3rd and 4.

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.