0

I have a particularly "hacky" question/solution and looking for some honest feedback.

In an enterprise system there are a number of requests that are destined for www.sometargeturl.com. These need to be diverted to www.newdestination.com.

Edit: We're not in charge of www.sometargeturl.com so can't put in 301 re-directs using .htaccess or anything here.

Rather than change all the code on the enterprise systems, I was wondering if a firewall/packet sniffer solution would work?

All traffic is routed through a Windows proxy server before it goes out onto the internet.

One solution I can think of would be to install a firewall or packet sniffer on the proxy server. The firewall would be programmed to look for packets addressed to www.sometargeturl.com and forward them instead to www.newdestination.com.

It's important that the full HTTP request is forwarded, and that it doesn't reach its original destination.

All thoughts appreciated, this isn't a great solution by any means!

Duncan

Duncan
  • 325
  • 2
  • 6
  • 11
  • **Provide more Details!** Sure HTTP can be redirected, but you haven't told us anything about your environment, so don't expect much in the way of a detailed answer. You say the users are going through a proxy, what type of proxy? What OS? How are clients configured to use this proxy (transparent, manual config, wpad,???) Presumable you have some kind of border firewall/router already doing NAT, what kind/OS. – Zoredache Apr 16 '14 at 20:40
  • Have added a few more details, however the honest answer is I don't have all the details yet! I think it's more NAT that I want to do here, forwarding all the packets to a different IP than the one it is destined to. – Duncan Apr 16 '14 at 21:17
  • Do you have control of newdestination.com ? – Zypher Apr 16 '14 at 21:30

2 Answers2

1

I don't know if this fits in your plan, but on an apache webserver a .htaccess file could do this redirection also for you

place a .htaccess file with the following line in the webserver documentroot of www.sometargeturl.com

Redirect / http://www.newdestination.com/

bart
  • 11
  • 1
  • This - you should be using an inbound proxy for this, and Apache is quite suited for the job. – mfinni Apr 16 '14 at 20:54
  • Thanks but I should have mentioned that we're not in charge of the sometargeturl.com so can't do any re-directs here I'm afraid! – Duncan Apr 16 '14 at 21:15
0

to do something like this you should setup static nat on a host in the middle. Setup a static nat rule sending their ip address to the ip address of the server you'd like their traffic to go to - I'm assuming you have access to their firewall or something like that. Make sure the site you want the request going to is setup to answer requests for www.sometargeturl.com. How to setup static nat depends on what networking gear you're using.

Some Linux Nerd
  • 3,327
  • 3
  • 19
  • 22