Jump to content


Photo

UniServer Zero: wildcards not working for vhosts?


  • Please log in to reply
1 reply to this topic

#1 newuni

newuni

    Newbie

  • Member
  • Pip
  • 3 posts
  • Main OS: Windows 7

Posted 17 January 2014 - 09:55 PM

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.



#2 Ric

Ric

    Project Manager

  • Admin
  • PipPipPipPipPip
  • 1,535 posts
  • Gender:Male
  • Location:Cambridge,UK
  • Interests:Electronics
    Internet in general
    Open source projects
  • SourceForge IDmpgcan
  • Wiki ID: Ric
  • Main OS: Windows XP

Posted 19 January 2014 - 08:36 AM

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






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users