如何允许用户将其域名映射到我网站上的网址?

时间:2022-09-11 11:32:03

How do I allow users to map their domains to a url on my site? (like how tumblr or blogger does)

如何允许用户将其域名映射到我网站上的网址? (就像tumblr或博客一样)

The app is being developed in Django. I want the users to be able to map their domains to mydomain.com/username (is this possible or do I need to have a format like username.mydomain.com?)

该应用程序正在Django开发。我希望用户能够将他们的域映射到mydomain.com/username(这是可能的还是我需要像username.mydomain.com这样的格式?)

Also my app runs on a VPS so I have my nameservers as ns1.mydomain.com and ns2.mydomain.com.

此外,我的应用程序在VPS上运行,因此我的名称服务器为ns1.mydomain.com和ns2.mydomain.com。

2 个解决方案

#1


easiest way is through domain cloaking. most domain name providers will allow users this option.

最简单的方法是通过域名隐藏真实内容。大多数域名提供商都会允许用户使用此选项。

another easy idea is to provide your users with a very generic html page that just includes their url on your site in an iframe and have them places that as their default directory index (e.g. index.html).

另一个简单的想法是为您的用户提供一个非常通用的html页面,其中只包含您在iframe上的网站上的网址,并让他们将其作为默认目录索引(例如index.html)。

both the aforementioned would always show the base domain (without trickery). as noted below, a CNAME DNS record would take care of this, assuming they have the ability to edit DNS records...

前面提到的都会显示基本域(没有欺骗)。如下所述,CNAME DNS记录会处理这个问题,假设他们有能力编辑DNS记录......

www.someuserdomain.com.  CNAME username.yoursite.com

#2


In that case, you will have to consult your specific hosting setup for how to programmatically change your DNS settings. Whether you can actually do this depends on the host. If your server is running a DNS server that you have access to, you can probably change it that way.

在这种情况下,您必须咨询您的特定主机设置,了解如何以编程方式更改DNS设置。是否可以实际执行此操作取决于主机。如果您的服务器正在运行您有权访问的DNS服务器,则可以通过这种方式进行更改。

#1


easiest way is through domain cloaking. most domain name providers will allow users this option.

最简单的方法是通过域名隐藏真实内容。大多数域名提供商都会允许用户使用此选项。

another easy idea is to provide your users with a very generic html page that just includes their url on your site in an iframe and have them places that as their default directory index (e.g. index.html).

另一个简单的想法是为您的用户提供一个非常通用的html页面,其中只包含您在iframe上的网站上的网址,并让他们将其作为默认目录索引(例如index.html)。

both the aforementioned would always show the base domain (without trickery). as noted below, a CNAME DNS record would take care of this, assuming they have the ability to edit DNS records...

前面提到的都会显示基本域(没有欺骗)。如下所述,CNAME DNS记录会处理这个问题,假设他们有能力编辑DNS记录......

www.someuserdomain.com.  CNAME username.yoursite.com

#2


In that case, you will have to consult your specific hosting setup for how to programmatically change your DNS settings. Whether you can actually do this depends on the host. If your server is running a DNS server that you have access to, you can probably change it that way.

在这种情况下,您必须咨询您的特定主机设置,了解如何以编程方式更改DNS设置。是否可以实际执行此操作取决于主机。如果您的服务器正在运行您有权访问的DNS服务器,则可以通过这种方式进行更改。