The question about second-level domain names in website navigation has been a long struggle

Source: Internet
Author: User
The second-level domain name of website navigation has been entangled for a long time. for example, a website, such as navigation, has an action comedy sci-fi

Corresponding to the second-level domain name, I will use my site for example, not an advertisement,

Action now is: http://www.cuangs.com/Dongzuopian/ should correspond to http://Dongzuopian.cuangs.com

Comedy is now: http://www.cuangs.com/Xijupian/ should correspond to http://Xijupian.cuangs.com

Science fiction is now: http://www.cuangs.com/Kehuanpian/ should correspond to http://Kehuanpian.cuangs.com

There must be a lot of questions like love and suspense.

Do I need to bind a secondary node? I am confused when writing it here, that is, how should I operate the secondary node? Online.


Reply to discussion (solution)

It seems that you can simply rewrite it with a URL.

Your website http://www.cuangs.com does not support second-level domain names
Please contact the domain name supplier to enable second-level domain name resolution

Your website http://www.cuangs.com does not support second-level domain names
Please contact the domain name supplier to enable second-level domain name resolution


Yes. I have VPS and other websites that have used Level 2

Learning

I have done a similar job. many regional sub-stations
If it is an independent host, you don't have to worry about it. the second-level domain name directs directly to the root directory. you can't save the VM.
GET a system variable at the program entry, add $ _ GET and rewrite.

The second-level domain name is controlled by the DNS service provider, not the vps provider, unless the two are the same
The second-level domain name is divided into two methods: host and jump. you are redirected. the jump is also divided into explicit and non-explicit, depending on whether the DNS service provider provides it, it seems that many DNS service providers in China do not support explicit jump
The above is not clear. go to Wikipedia.

If it is supported, the http://Dongzuopian.cuangs.com should access (even the wrong page) instead of prompting domain name errors

Wildcard parsing. I have never done this before. I used to manually bind Windows IIS one by one. I don't know how to perform this operation in linux.

Actually, there is no mystery. three steps are done.
1 domain name for wildcard resolution is *. the domain name is then separately bound to a host header site
2. obtain the currently accessed domain name through the user's $ _ SERVER ['http _ host ']
3. obtain the user name based on the currently accessed domain name, and then obtain other information.

Well, wildcard parsing is acceptable. you can also combine $ _ SERVER ['http _ host']. thank you for your attention.

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.