When you automatically create subdomains when registering users, does it create a new website or gives the appearance of the website?

I wonder if the subdomains created during registration will become websites, or do they just give the illusion that they are websites like example.com/username?

Am I trying to create something like user.domain.com and can't find something useful for this? Is there a way to do this so that I can allow account settings for clients?

I need them to be separate websites so that I can go and customize them according to client requests, so what is the best way to do this?

+2
source share
4 answers

, , "" -.

, , , , . "", . , "", - -, , , , " ". ( , URL- .)

0

-. , Apache httpd.conf, VirtualHost. :

<VirtualHost *:80>
ServerName subdomain.domain.org
DocumentRoot "apache2/htdocs/domain/"
</VirtualHost>

Uri subdomain.domain.org apache2/htdocs/domain/. , .

+4

, . , - example.com -, subdomain.example.com - , . , , / DNS.

, , example.com *.example.com, . Apache ,

VirtualDocumentRoot /path/to/site/subdomains/%1

, , , cookie . FTP, - , subdir , chrooted -, , , / -. ( , VirtualDocumentRoot, mod_vhost_alias. mod_rewrite, , , ​​ FTP.)

+2

DNS *.domain.com, , jack.domain.com .

, .htaccess , *.domain.com. htaccess.

, - jack.domain.com, , : ", jack , , jack. , jack.

There are many different ways to customize, so it’s hard to say how to adapt to your needs. But hopefully this is enough information to get you started. Just remember that if you are testing a local host, localhost HOSTdoes not allow wildcard DNS names, so for testing you need to manually add each subdomain to this host file for testing.

+2
source

Source: https://habr.com/ru/post/1776142/


All Articles