newuni Posted January 18, 2014 Report Share Posted January 18, 2014 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.comThe 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. Quote Link to comment Share on other sites More sharing options...
Ric Posted January 19, 2014 Report Share Posted January 19, 2014 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.com127.0.0.1 www.demo.comWhen creating an Apache Vhost, Uniform Server adds only the entered host name to the hosts file for example demo.comTo 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.