How multi-user systems bind international domain names

Source: Internet
Author: User
Tags bind

Multi-User system in the network is very common, such as Taobao or shopping online shop is the most typical multi-user system, each owner has a two-level domain name of the store (such as: http://shop88888888.xiegoo.com/), it seems that everyone is independent, But from the technical perspective, in fact, every shop is using the same set of procedures, the only difference is the shop interface and data.

believe that the realization of such a two-level domain name point to the function of different stores, for most programmers is not difficult, because the shop behind the 88888888 hidden store only ID, through the shop88888888 of the store's interface and data from the database to filter out is very simple, I don't explain it in detail here either. But we often see on the internet many "multi-user mall" or "Build station system", support binding international domain names, such as the purchase of their own independent shop system http://www.shopxg.com/, as long as online registration, online binding international domain name, you can access their online shop. I have been involved in the development of SHOPXG, how to achieve such a function, take out to share with you, of course, may not be the best and most effective method, but hope to help those who are worried about the problem of technical friends.

Because SHOPXG is used. NET development, so the situation I mentioned below may not be suitable for other language systems, but the principle is interlinked, hoping to give you a little enlightenment.

The first step: the design of the database, in the "store shop" This table, to set a field, storage of international domain names;

The second step: in the SHOPXG site to do a pan-resolution, is to make any point to the SHOPXG site of the server's international domain name, will be bound to the SHOPXG, as to how to do a pan-resolution, you can go to Google check;

Step three: Take the shoplogin.aspx page of the front desk for example, when a customer enters www.yifull.com/ShopLogin.aspx and www.tiaopidan.com/ shoplogin.aspx, the shoplogin.aspx page will immediately get to the currently entered domain name, such as the use of request.servervariables["SERVER_NAME". ToString (); Of course shopxg is using urlrewrite rewrite technology to get the current domain name, there are many ways, you can choose for yourself;

The fourth step: using the current domain name, to the database to accurately match to a store, and then the store data to the foreground display;

Of course, the above steps are very easy to achieve, is not a problem, but the implementation of a multi-user system in each store to bind the international domain name, there are many small problems can not be overlooked:

1. Each page frequently gets the current domain name, then to the database matching, just know which store in the request data, will cause system inefficiencies, so we want to let the customer first access to a domain name, the get back shop number into local cookies, when customers continue to visit or next visit , directly from the cookies can know the current domain name corresponding to which store;

2. User Login problem: The general website is to use cookies to store whether I have landed a website information, for multi-user systems, if the user landing, cookies did not build, it is easy to create a landing site, it is equivalent to landing on the multi-user system on all sites; If you can login to other people's Web site backstage, the consequences will be disastrous; sometimes it can even cause my orders to have someone else's order, which is caused by cookies. Therefore, when we build cookies, we must distinguish the domain, in the process of judging the user landing, Also want to strictly judge the input domain name and cookies in the field is corresponding;

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.