Jump to content
The Uniform Server Community

UniServer Zero: wildcards not working for vhosts?


newuni
 Share

Recommended Posts

Using UniServer Zero XI 11.0.5/UniController X1 V1.0.5 on Win7.

 

I create a new vhost, eg: demo.com

 

When I go to demo.com I am taken to the local directory. This is correct.

 

But when I try www.demo.com I am taken to the actual online website of demo.com.

 

The hosts file is being updated with: 127.0.0.1 demo.com

The proxy.pac file is being updated with: if (shExpMatch(host, "*demo.com")) return "PROXY 127.0.0.1:80";

 

Shouldn't the wildcard asterisk allow me to type anything before demo.com (www.demo.com, subdomain.demo.com, etc.) and be taken to the local directory?

 

I have also tried this with .org and .co.nz suffixes. Same result. I have rebooted the server after any changes.

Link to comment
Share on other sites

But when I try www.demo.com I am taken to the actual online website of demo.com.

 

I am assuming you are using the Windows hosts file to resolve host names. Each entry in the hosts file must be unique for example:

127.0.0.1 demo.com

127.0.0.1 www.demo.com

When creating an Apache Vhost, Uniform Server adds only the entered host name to the hosts file for example demo.com

To resolve www.demo.com you need to manually enter this host name into the hosts file.

From UniController select Extra>Edit Win hosts file, in the pop-up utility add www.demo.com

 

In contrast the proxy.pac file uses the wild card and as you rightly said allows anything before the domain name demo.com to be included. See documentation for details how to use proxy pac files.

 

Note: If the host name for example www.demo.com has been previously resolved it will reside in your browser cache this will overrides entries in the hosts file and produce incorrect resolution. Restart your browser to clear the cache or use browser tools to clear it

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...