0

I am trying to redirect unwanted HTTPS URLs to a proxy and display a custom error page.

First, my pac file is served by an IIS10 Website bound on port 80 to the clients.

Second, in my pac file i check a few URL with dnsDomainIs and if the domain match it goes directly on Internet.

Third, in my pac file, if the domain does not match it redirect to another website running on the same IIS bound on another port to display a specific webpage.

I would say everything is running so far except when, on the client, I try to see if https://www.google.com is redirected to the proxy (website) and the client browser displays the custom webpage but nada :-/

I mean the big picture is to display on the client browser a custom page every time he browses a website that does not match the one in the PAC.

I have used those rules in my pac:

function FindProxyForURL(url, host) {

if (dnsDomainIs(host, "www.hp.com")) { return "DIRECT"; }

// every other http: URLs will redirect to the localhost:8080 to display an error page
if (url.substring(0,5)=="http:" ) { return "PROXY localhost:8080"; }

// below the rest like https should be redirected to the localhost:443
else { return "PROXY localhost:443"; }  

}

For every website with URL starting like https://onedrive.live.com/about/en-us/ it seems not to be redirected through the localhost:443 and the client browser does display the page related to the URL and not my custom page.

Any help very apreciated, I am out of ideas,

Thanks a lot.

Yop

Yopplay
  • 1
  • 1

0 Answers0