php.htaccessapache2.4hotspothtdocs

how to set multible hosts using one server and show them on hotspot or any connected device with [ no web ]


if having this file tree:

* www    // localhost    # developer
|\
| * x    // dom1.ext
| |
| * y    // dom2.ext
| |
| * z    // leader.com   # immediately provided site when wifi conect 》 includes links to other domains [ dom1.ext, dom2.ext, ... ]
| /
/

I want my local server to provide these domains using hotspot

》 every domain should have a folder in www to provide data from, but all has the same configration files

》 only just who has access to the computer can see the server developer side [ localhost ip is ::1 #satisfy or not ? ]

》 any other should be redirected immediately to [ leader.com ] when conecting to wifi

this should work if internet is connected or not


I tried so much to use "hosts" file to specify a hostname then made apache listen to it using "htdocs.config"

》 host is supplied locally only on device not all network


in the config it just use one dir

》 how to use multiple [ one for each domain ]


it dosn't matter what ever you used from [ question tags ], just "how to acheve this or a part of it"; even a small information could help me


Solution

    1. add entery for your virtual domain in hosts file or your virtual/local dns server
    2. add <virtualhost> tag in htdocs.config - one for each virtualhost
    3. use the code in your site to iterate over <virtualhost> tags and hosts then generate the site list you want