2

I am trying to setup virtual domain in my localhost dynamically. i have setup in httpd-vhost.conf and its working fine.

then i setup in hosts file which present in C:\Windows\System32\Drivers\etc

my requirement is i want to setup my domain like

1.domian.com, 2.domain.com, 3.domain.com, 4.domain.com,...., n.domain.com

i had set up in host file

127.0.0.1       domain
127.0.0.1       1.domain.com
127.0.0.1       2.domain.com
127.0.0.1       3.domain.com

its working fine if i browse 1.domain.com, 2.domain.com and 3.domain.com

setting n subdomain can be really complicated. It's indeed critical

is there an easy way to add n subdomain in host file?

serv-inc
  • 35,772
  • 9
  • 166
  • 188
psanjib
  • 1,255
  • 2
  • 15
  • 24
  • You would better ask this on http://serverfault.com/ or http://unix.stackexchange.com/. You can use your http://stackoverflow.com/ account for this, linking it to these communities too. Go to the site, upper right click on "join this community". The historical root of the stackechange network, SO (StackOverflow), is for programming questions. – jbm Mar 30 '16 at 06:23
  • @psanjib Mate , did you find the solution . even me looking out for the solution on same stuff. – Raja Gopal Sep 24 '16 at 03:00
  • I got a solution mate , check this link http://stackoverflow.com/questions/39671989/php-writing-to-host-file-programmatically/39672149 – Raja Gopal Sep 24 '16 at 04:00

0 Answers0