Creating subdomains dynamically for an application

回眸只為那壹抹淺笑 提交于 2019-12-03 23:06:23

Take a look into wildcard subdomains. Once you have all of the "subdomains" going to the right place, you can use url rewriting and/or some other mixture of redirecting to create the effect of subdomains without having to constantly update a httpd.conf setup and/or DNS tables.

If you are using Apache on a Linux box, you can create new VirtualHosts for each subdomain. Here is a guide for Debian/Ubuntu which may also work for other distros.

Basically: each entry goes into its own file under /etc/apache2/sites-enabled. Whenever an entry is added/changed/removed, you run 'sudo /etc/init.d/apache2 reload' to update the virtual hosts / subdomains.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!