Example: I simplified it a little for readability and its been a while since I played with this so don't recall if this one actually was a working copy.<\/strong><\/p>\n\r\n<?php\r\n $proxy = "mainsquid001.domain.com";\r\n $port = "3128";\r\n\r\n header ("Content-type: application\/x-ns-proxy-autoconfig");\r\n header ("Date: " . gmdate('D, d M Y H:i:s \\G\\M\\T', time ()));\r\n header ("Last-Modified: " . gmdate('D, d M Y H:i:s \\G\\M\\T', time ()));\r\n header ("Expires: " . gmdate('D, d M Y H:i:s \\G\\M\\T', time () + 60 * 30));\r\n\r\n #echo "\/\/ Request from: " . $_SERVER ['REMOTE_ADDR'] . "\\n";\r\n #echo "\/\/ OS: " . $_SERVER ['HTTP_USER_AGENT'] . "\\n";\r\n\r\n $netProxyMap = array('172.16'=>'uksquid001','172.19'=>'casquid001');\r\n \/\/ I removed a lot of subnets from above array for readability.\r\n $ipA = explode(".", $_SERVER ['REMOTE_ADDR']);\r\n $bNetPart = $ipA[0] . "." . $ipA[1];\r\n $cNetPart = $bNetPart . "." . $ipA[2];\r\n \r\n if ( array_key_exists($cNetPart, $netProxyMap) ) {\r\n $proxy = $netProxyMap[$cNetPart] . ".domain.com"; \t\r\n } else {\r\n\tif ( array_key_exists($bNetPart, $netProxyMap) ) {\r\n $proxy = $netProxyMap[$bNetPart] . ".domain.com"; \t\r\n }\r\n }\r\n?>\r\n\r\n\/\/ Proxy Servers\r\nvar proxy = "PROXY <?php echo $proxy; ?>:<?php echo $port?>;";\r\nvar dmzproxy = "PROXY dmzproxy.domain.com:3128;";\r\n\r\n\/\/ Proxy Logic\r\nfunction FindProxyForURL(url, host)\r\n{\r\n if (url.substring(0,6)=="https:") { return "DIRECT"; }\r\n\r\n else if (shExpMatch(url,"*.google.com*") ||\r\n shExpMatch(url,"*.gotomeeting.com*") \r\n { return "DIRECT"; }\r\n\r\n else if ((host == "localhost") || (shExpMatch(host, "localhost.*")) || (host == "127.0.0.1")) \r\n { return "DIRECT;"; }\r\n\r\n else if ( (host == "hostedext1.domain.com") || (host == "hostedext2.domain.com") \r\n { return olddmzproxy; }\r\n\r\n else if ((host == "www.domain.com") || (host == "dmzapp1.domain.com") \r\n { return dmzproxy; }\r\n\r\n else if (shExpMatch(url,"http:\/\/domain.com\/")) { return dmzproxy; }\r\n\r\n else if (dnsDomainIs(host, ".domain.com")) { return "DIRECT;"; }\r\n\r\n else if (isPlainHostName(host)) { return "DIRECT;"; } \r\n\r\n else return proxy;\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"Some businesses still rely on the the Proxy auto-config file format originally designed by Netscape in 1996.\u00a0 I have had<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,18],"tags":[],"class_list":["post-85","post","type-post","status-publish","format-standard","hentry","category-php","category-squid"],"_links":{"self":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/85","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/comments?post=85"}],"version-history":[{"count":0,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/85\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/media?parent=85"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/categories?post=85"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/tags?post=85"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}