create a sub website of the parent website for each user(sub domain or subfolder)

*爱你&永不变心* 提交于 2019-12-22 11:27:44

问题


My client asked me to create a new sub folder or sub directory for each user. My main URL is like www.mysite.com, after creating a user the user should be able to access it as www.mysite.com/userName or www.userName.mysite.com. Is it possible to do through JSP, i dont know exact what key words should be used to search in google for this problem. I use JSP, Apache tomcat 5.5, mysql 5.0 for my development. Do i have to copy all the contents to subfolder do this? If so where i could get some help or tutorial?


回答1:


that can be done in httpd.conf e.g.

ServerName www.userName.mysite.com
RewriteCond %{HTTP_HOST} ^www\.userName\.mysite\.com$ [NC]


来源:https://stackoverflow.com/questions/10351085/create-a-sub-website-of-the-parent-website-for-each-usersub-domain-or-subfolder

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