Local .test domains on Windows
localhost/blog breaks absolute URLs, cookies and redirects. A real name per project, such as blog.test, behaves like production. .test is reserved for exactly this and never exists on the internet.
How Lumina does it
- Every folder in the
wwwfolder becomesfolder.test. - Lumina writes the web server config for it (nginx or Apache), with the right document root:
public,webor the folder itself. - It adds the names to the Windows hosts file, with one administrator prompt when the list changes.
Set it up
- Install Lumina and a web server from Quick Add, then Start All.
- Create a folder in
www, for exampleC:\Lumina\www\blog. - Open
http://blog.test. The Sites page lists every site and says whether the hosts file is up to date.
Another suffix
Prefer .localhost or your own suffix? Change Domain suffix on the Sites page. Avoid .dev and .app: they are real top-level domains that browsers force to HTTPS.
Questions
Why not .local?
It is used by mDNS (Bonjour), which can make lookups slow or fail. .test is reserved for testing.
Do phones on my Wi-Fi see these sites?
With "Share on my network" on the Sites page, yes, at an address like http://blog.192.168.1.20.nip.io, with a QR code.
Related guides
-
Trusted HTTPS for localhost
Get https://localhost and https://project.test with a padlock and no browser warning, using a certificate authority that exists only on your computer.
-
Run PHP 7.4 and PHP 8.4 side by side on Windows
How to run several PHP versions on Windows at the same time, PHP 7.4 to 8.5, and give each project its own version, without editing Apache or nginx configs by hand.