How to redirect http requests?

Use this forum to post questions relating to WinGate, feature requests, technical or configuration problems

Moderator: Qbik Staff

How to redirect http requests?

Postby aashiqdil » Sep 21 07 1:50 am

Dear All

I am using win gate 6.2.0 with 50 computers in LAN. All the computers are using net via proxy server. I want to redirect the http request using wingate. I want when a user wants to open google.com then instead of google he get yahoo.com. Can I do this with wingate?

Secondly if I want to ban a particular user for using internet then can I do this?

Thanks

Aashiq
aashiqdil
 
Posts: 2
Joined: Sep 21 07 1:43 am

Postby aashiqdil » Sep 22 07 10:22 pm

Hello all

Please help me in this. I am despirately waiting for your reply

Aashiq
aashiqdil
 
Posts: 2
Joined: Sep 21 07 1:43 am

Postby adrien » Sep 24 07 10:58 pm

Hi

This is a feature we have working for the next version, but it's not supported in WinGate 6.x

Regards

Adrien
adrien
Qbik Staff
 
Posts: 5448
Joined: Sep 03 03 2:54 pm
Location: Auckland

Postby logan » Sep 25 07 9:21 am

There is a `roundabout` way that you can redirect HTTP requests in version 6.x, but it can get a bit involved if you plan to do alot of redirecting. I have included a guide on how we managed to do this below for you. Maybe this will be a suitable solution until the next version of WinGate is released.


The main function of the WWW Proxy Server in WinGate is to receive "proxy" requests from your client computers and then act on these requests on behalf of the client computer, however there is another function of the WWW Proxy Server that allows you to specify how the Proxy reacts to Server requests aswell. One of the actions that you can specify for a server request is to "redirect" the request to another URL.

Knowing this, all you need to do is fool your client computers into thinking that the Wingate computer is the host for google.com so that the WWW Proxy can pick up the request and redirect it. As long as your client computer has the WinGate computers IP set as it's DNS server, you can do this using the "Hosts" file on your WinGate server.

- Gatekeeper -> System tab -> DNS/WINS Resolver -> DNS
- Click on the Edit button on the lower right hand side of the window
- Add new entries to the hosts file for any URL's that you want to redirect and set the IP address to the WinGate computers internal IP address. e.g.
Code: Select all
www.google.com       192.168.1.1
google.com           192.168.1.1
- Save and close the hosts file

Wingate will start resolving DNS requests for google.com and www.google.com as 192.168.1.1, rather than the actual public IP address of google.com. Now you just need to configure the WWW Proxy Server to rredirect these domains to yahoo.com.

- Gatekeeper -> Services tab -> WWW Proxy Server -> Web Server
- Click Add
- Change the action to redirect
- Enter the URL as "www.yahoo.com"
- Goto the hosts tab
- Click Add
- enter "www.google.com"
- Click Add again
- enter "google.com"
- Click OK, then OK.


That should be it. You're client computers will now think that the WinGate computer is hosting google.com and will ask WinGate for the site. WinGate will then receive these requests for google and redirect them to Yahoo.

Note: This may take a while to start working properly because of DNS caching. You can do use the following command in the command prompt to reset the DNS cache of your client computers.

Code: Select all
"ipconfig /flushdns"
logan
Qbik Staff
 
Posts: 671
Joined: Oct 19 06 2:49 pm
Location: Auckland, New Zealand


Return to WinGate

Who is online

Users browsing this forum: No registered users and 3 guests