How do I allow users to map their domains to a url

2019-06-01 02:46发布

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

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?)

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

2条回答
对你真心纯属浪费
2楼-- · 2019-06-01 02:53

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.

查看更多
甜甜的少女心
3楼-- · 2019-06-01 03:11

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).

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...

www.someuserdomain.com.  CNAME username.yoursite.com
查看更多
登录 后发表回答