1

I've been at this for a while and i'm stumped. I need to create and Automatic Configuration script for one of our servers. It needs to be able to individually block/reroute certain url's.

For example, our product uses Facebook and if the facebook API goes down I want it to easily be able to reroute to a page that says "Error ..". Or if I need to block just facebook to do some testing it would be possible.

I've read many articles and even found a tutorial on .pac files (Designing and implementing effective PAC file solutions). When testing this I've written a script. However, when I import it in Internet Explorer 9 it doesn't do anything.

Any help would be of assistance and greatly appreciated.

Example code. I just want it to redirect to Google if the facebook url is used.

function FindProxyForURL(url, host) { 
    if(url.substring(0, 15) == "www.facebook.com") return "www.google.com: 8080";
else return "DIRECT"; }
Anne
  • 26,765
  • 9
  • 65
  • 71
user1016748
  • 11
  • 1
  • 3

1 Answers1

1

pac files only support 3 directives in the return value: PROXY url, SOCKS url and DIRECT.

To do what you want, you will want to PROXY to a proxy server that you own, that does the access check.

Cine
  • 4,255
  • 26
  • 46