简体   繁体   English

带有 Cname 的 PHP 允许用户使用自己的域

[英]PHP with Cname allowing users to use their own domain

I was wondering how do I allow users to use their own domain for example usersdomain.com or example.usersdomain.com and point a cname to like dns.example.com and then when they go to their domain/subdomain it will show them content, but it will be different content for each of the domains? I was wondering how do I allow users to use their own domain for example usersdomain.com or example.usersdomain.com and point a cname to like dns.example.com and then when they go to their domain/subdomain it will show them content ,但每个域的内容会有所不同吗? Im trying to do a system where people can use their down domain for our product but not actually give out our code for the system.我试图做一个系统,人们可以将他们的下域用于我们的产品,但实际上并没有为系统提供我们的代码。 I also dont want to do this with any framework I want to do it with PHP by it self..我也不想用任何我想用 PHP 自己做的框架来做这件事。

-- Edit - 编辑

Trying to figure out how to do just make the cname work right now i have a domain with a subdomain on cpanel for one of the things for example dns.serverhost.com then I have another domain im trying to point a cname of test1.mydomain.com to dns.example.com but it just shows the page on cpanel Default Web Site Page with the Sorry message on it.试图弄清楚如何立即使 cname 工作我在 cpanel 上有一个带有子域的域,例如 dns.serverhost.com 然后我有另一个域我试图指向一个 cname test1.mydomain .com 到Sorry但它只是在 cpanel 上显示页面Default Web Site Page I want to be able to run my system entirely on cpanel, also the page that shows the Sorry thing is on the test.mydomain.com我希望能够完全在 cpanel 上运行我的系统,同时显示Sorry的页面也在 test.mydomain.com

Use $_SERVER['HTTP_HOST'] to get requested hostname from HTTP request headers.使用$_SERVER['HTTP_HOST']从 HTTP 请求标头中获取请求的主机名。 You have to make sure, that the requested domain is configured at webserver level or your site is configured as default host.您必须确保请求的域是在网络服务器级别配置的,或者您的站点被配置为默认主机。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM