dqhsv0147421 2015-08-31 14:08
浏览 34

为每个注册的公司创建子域

So i have built an application which allows companies to sign up. Once the company have created an account they can then add their own users.

So i have a database which contains all companies and users just separated by a company ID essentially.

Now the way i have it at the minute is that they just log in at the main website, but i came across another web application that creates a subdomain for each company that signs up.

For example company1.mywebsite.com and the next company would be company2.mywebsite.com.

How can i achieve this so that when a company signs up it automatically creates a new subdomain which their company name first?

  • 写回答

1条回答 默认 最新

  • doudi8829 2015-08-31 14:11
    关注

    You would require a Wildcard DNS record, which would point to your application.

    From there, the application would fetch the domain name from $_SERVER['HTTP_HOST'], and you could use that to decide which company you are working with.

    评论

报告相同问题?

悬赏问题

  • ¥15 关于smbclient 库的使用
  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画