Redirect an http request to a local web server

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

Moderator: Qbik Staff

Redirect an http request to a local web server

Postby jiandc » Aug 13 05 7:58 pm

Hi,

How do I redirect an http request to a local web server? Example, if the user enters http://www.wingate.com, the user should not get the actual www.wingate.com webpage but our local web server's page. I wanted to do this on several web addresses.

Regards,

Jian
jiandc
 
Posts: 85
Joined: May 11 04 12:47 am

Postby ChrisH » Aug 16 05 3:57 am

Hi,

I think this might do what you are looking for. If you use the WWW proxy service in WG either directly or by Transparent Redirection you can tell WG to redirect non proxy connections to another web server. In WWW proxy service select the Server Requests tab and choose the Pipe request through to predetermined server then enter the computer name or address of intranet web server and port number. Then when your end users want to go to the intranet they would just enter machine name in their browser. WG will also act as a web server if you don't have another web server. Let us know if this helps.
Chris H.
ChrisH
WinGate Master
 
Posts: 388
Joined: Sep 13 03 1:38 am
Location: Canada

Postby jiandc » Aug 16 05 11:59 pm

Hello,

I wanted to apply it to a specific website only and not all non-proxy request. The website that users are trying to access exist on the internet, but I want them to see the page hosted in our local web server.

Regards,
jiandc
 
Posts: 85
Joined: May 11 04 12:47 am

Postby jamesc » Aug 17 05 5:56 pm

This is one way it could be done. It may depend where your internal website is hosted. So first of all, I am assuming your clients connect to the WinGate server via proxy. So what we want to do is catch a DNS request on the WinGate server for e.g. www.wingate.com, and reply with its address as a computer on the local network. To catch a DNS request before querying a DNS server, we use the "hosts" file.

On a 2k / XP machine the hosts file is located at C:\WINDOWS\system32\drivers\etc . Open the hosts file with notepad. You will see a "localhost" address in there. We will add the new www.wingate.com below it.

e.g

127.0.0.1 localhost
192.168.1.1 www.wingate.com

Then save. Please make sure there is no file extension placed on the hosts file. You can quickly test by opening a command window and pinging www.wingate.com

(Windows) Start menu --> Run --> cmd --> ping www.wingate.com

Now whenever a proxy request comes in for www.wingate.com, the host file will be checked, and reply with the IP Address without requiring to Query a DNS server on the internet



*** If you require to do this without using the proxy, then you will need to modify the hosts file on each client computer. This can be done with a policy or login.bat file. If I hear of a better way, will advise.
jamesc
Qbik Staff
 
Posts: 928
Joined: Apr 04 05 2:04 pm
Location: Auckland, New Zealand

Postby jiandc » Aug 18 05 5:18 am

Yes this can be done but I will have to do it on all computers. I was hoping that wingate will do the forwarding/redirection since it knows all web traffic.
jiandc
 
Posts: 85
Joined: May 11 04 12:47 am

Postby jamesc » Aug 18 05 9:04 pm

This will only need to be done on the WinGate server if you are using direct proxy connections.

1. What connection methods do you use? Proxy / NAT / WinGate Internet Client (WGIC) / Intercepts (Transparent Proxy)
2. What DNS server do you / can you use? WinGates, ISP, Another DNS Server on your LAN?
jamesc
Qbik Staff
 
Posts: 928
Joined: Apr 04 05 2:04 pm
Location: Auckland, New Zealand


Return to WinGate

Who is online

Users browsing this forum: Google [Bot] and 33 guests