Jump to content
View in the app

A better way to browse. Learn more.

The Uniform Server Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

UniServer Zero: wildcards not working for vhosts?

Featured Replies

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.

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

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...

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.