Last Updated: September 09, 2019
· cossou

Local development and subdomains


did you ever wanted to work with real domain names and subdomains on your local machine?

It's easy, just create a file named .proxy.pac with:

function FindProxyForURL(url, host) {
    if (shExpMatch(host,"*.<YOUR_DOMAIN>")) {
        return "PROXY localhost";
    return "DIRECT";

Now go to your Firefox and open Preferences > Advanced > Network > Settings... > Automatic Proxy Configuration URL and put:


And that's it! It can work with other browsers (didn't test it myself).

Source & credits: Stackoverflow