if you are asking like page1.domainname.com 3page.domainname.com 2page.domainname.com You need to set this on your dns. Start from that.
<VirtualHost *:80> ServerName www.example.com ServerAlias example.com *.example.com DocumentRoot /www/domain </VirtualHost> Adding the wildcard subdomain *.example.com, your PHP application will receive all requests for any domain below example.com, ie garbage.example.com, busted.example.com, llama.example.com, etc.