Wildcard Subdomains

后端 未结 8 905
广开言路
广开言路 2020-12-07 15:25

I know there have been a few threads on this before, but I have tried absolutely everything suggested (that I could find) and nothing has worked for me thus far...

W

8条回答
  •  庸人自扰
    2020-12-07 15:48

    First, I want to allow users to publish pages and give them each a subdomain of their choice (ex: user.mysite.com). From what I can gather, the best way to do this is to map user.mysite.com to mysite.com/user with mod_rewrite and .htaccess - is that correct?

    You may be better off using virtual hosts. That way, each user can have a webserver configuration pretty much independent of others.

    The syntax goes something like this:

    
        DocumentRoot /var/www/user
        ServerName user.mysite.com
        ...
    

提交回复
热议问题