Home >Backend Development >PHP Tutorial >How to let users add a second-level domain name and then direct this second-level domain name to their own website? Use nginx+tp
For example, our main website is test.com
Users can customize a second-level domain name of myweb.test.com on our website, and then transfer this domain name to his own website abc.com, and the website address has not changed, it is still myweb.test.com
Somewhat similar to Taobao’s merchant-customized domain name
What is the general idea? Does nginx need to configure anything?
Reply content:Users can customize a second-level domain name of myweb.test.com on our website, and then transfer this domain name to his own website abc.com, and the website address has not changed, it is still myweb.test.com
Somewhat similar to Taobao’s merchant-customized domain name
What is the general idea? Does nginx need to configure anything?
This requires domain name resolution
=> abc.com
This is easier to implement. You can directly rewrite the URL to xxx.php, parse the path and then redirect it.
=> abc.com
If there are few websites, you can directly configure redirection in nginx
, but if the subdomain name needs to be dynamically redirected to the specified domain name, it feels like Not easy to implement.
Make a corresponding relationship, which can be placed in the sharedict of ngx_lua, and then redirect. Of course, if you need a small amount, just write it directly into the configuration
But that’s it Come on, aren't you afraid that users will redirect you to a place full of short movies?