On Wed, Jan 11, 2023 at 09:42:14AM +0000, rahul.dshmkh1 wrote:
> as per httpd.conf file i should be able to match exact one character in 
> server "a?.sitea.com"
> but when i test this way i am able to visit sitea, below are the test results
> :~> curl a.sitea.com
> This is site a
> :~> curl a1.sitea.com
> This is site a
> :~> curl ab1.sitea.com -->> this should not be matched? as there are two 
> characters after a

The domain 'ab1.sitea.com' does not match _any_ of the server entries in your
config.

In this case, the _first_ entry that matches the address and port is used, in
your case this is 'site a'.

If you add to /etc/hosts:

192.168.25.11 xyz.example

Then:

ftp -o - http://xyz.example

will show 'site a'.

So maybe you want to move your 'defaultsite' to the top of the config file.

> --------------------------------
> /etc/httpd.conf
> server "a?.sitea.com" {
> listen on * port 80
> root "/a.sitea.com"
> }
> 
> server "b.siteb.com" {
> listen on * port 80
> root "b.siteb.com"

Why is this not have a leading / like your other entires?

> }
> 
> server "defaultsite.com" {
> listen on * port 80
> root "/defaultsite.com"}
> 
> -----------------------------------------

Reply via email to