Q:

Apache HTTP Server 2.4.41 is confusingly serving virtual host pages

My httpd-vhosts.conf looks  like this:
<VirtualHost *:80>
    DocumentRoot "C:/Apache24/htdocs/rodde.net"
    ServerName rodde.net
    ServerAlias www.rodde.net
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "C:/Apache24/htdocs/coderodde.net"
    ServerName coderodde.net
    ServerAlias wwww.coderodde.net
</VirtualHost>

My C:Windows\System32\drivers\etc\hosts contains:
127.0.0.1 localhost
127.0.0.1 www.coderodde.net
127.0.0.1 www.rodde.net
127.0.0.1 rodde.net
127.0.0.1 coderodde.net

My C:\Apache24\htdocs\rodde.net\index.html contains:
<html>
<body>
<h1>
rodde.net works!
</h1>
</body>
</html>

My C:/Apache24/htdocs/coderodde.net/index.html contains:
<html>
<body>
<h1>
coderodde.net works!
</h1>
</body>
</html>

My C:/Apache24/htdocs/index.html contains:
<html>
<body>
<h1>Apache HTTP Server 2.4.41 works!</h1>
</body>
</html>

Finally, httpd.exe -S:
C:\Apache24\bin>httpd -S
VirtualHost configuration:
*:80                   is a NameVirtualHost
         default server rodde.net (C:/Apache24/conf/extra/httpd-vhosts.conf:23)
         port 80 namevhost rodde.net (C:/Apache24/conf/extra/httpd-vhosts.conf:23)
                 alias www.rodde.net
         port 80 namevhost coderodde.net (C:/Apache24/conf/extra/httpd-vhosts.conf:29)
                 alias wwww.coderodde.net
ServerRoot: "C:/Apache24"
Main DocumentRoot: "C:/Apache24/htdocs"
Main ErrorLog: "C:/Apache24/logs/error.log"
Mutex default: dir="C:/Apache24/logs/" mechanism=default
PidFile: "C:/Apache24/logs/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
Define: SRVROOT=c:/Apache24

My problem is this: '

When I visit rodde.netor www.rodde.net, I see the text rodde.net works!, as I should.
When I visit coderodde.net, I see the text coderodde.net works!, as I should.
However, when I visit www.coderodde.net or localhost, I see the text rodde.net works!.

A:

default server rodde.net (C:/Apache24/conf/extra/httpd-vhosts.conf:23)

This is your default server i.e. the default virtual host. It is used every time there's no matching explicit ServerName or ServerAlias. That's the case when you visit e.g. http://localhost.

port 80 namevhost coderodde.net (C:/Apache24/conf/extra/httpd-vhosts.conf:29)
        alias wwww.coderodde.net

This virtual host has two names: coderodde.net and wwww.coderodde.net, with four w's. That's why it won't match www.coderodde.net with three w's, and the default virtual host is used, instead. That's called a typo.

