
basecamphq.com과 같은 사이트에서 username.basecamphq.com이 있는 것을 본 적이 있을 것입니다.
비슷한 일을 하고 싶습니다. 모든 하위 도메인은 동일한 index.php 파일로 라우팅됩니다.
따라서 username1.example.com은 /home/some/path/to/www(여기서는 index.php임)를 요청하고 username2.example.com은 동일한 파일을 요청합니다.
로컬에서 작동하고 있지만 서버는 cPanel을 사용합니다. 아파치 구성에 대해 어떻게 추측하시나요?
답변1
<VirtualHost *:80>
DocumentRoot /home/some/path/to/www
ServerName www.example.com
ServerAlias *.example.com
</VirtualHost>
아마도 그런 것일까요?