Author Topic: Rewrite URL  (Read 1218 times)

Offline jnor

  • Contributor
  • *
  • Posts: 4
  • Karma: 0
Rewrite URL
« on: November 16, 2011, 04:45:26 AM »
Hi,

I would like to rewrite a url to an external site without end customer knowing it.
Do I have to involve content swithing or can I only use "url transformation"?

example:
rewrite https://www.internal.com/test/* to https://www.external.com/test/*

The browser should only show https://www.internal.com/test/*

Can anyone give me a hint how to do this?

/Jonas


Offline evildani

  • Administrator
  • Hero Member
  • *****
  • Posts: 389
  • Karma: 22
Re: Rewrite URL
« Reply #1 on: November 16, 2011, 05:26:55 AM »
Can you provide a little more of background?
From reading your post you seem to want a redirect. Redirecting all traffic from one service to another in the same path but different host.
Or you need to change the responses from the server so the user will end up in another host.

Daniel

Offline jnor

  • Contributor
  • *
  • Posts: 4
  • Karma: 0
Re: Rewrite URL
« Reply #2 on: November 16, 2011, 05:58:45 AM »
I want to do a redirect without the customer knowing it.
The internal url is hosted behind our Netscaler and the external url is hosted by a business partner.

So yes, I need to change the response so the user will end up in another host.

/Jonas

Offline cript2000

  • Contributor
  • *
  • Posts: 8
  • Karma: 0
Re: Rewrite URL
« Reply #3 on: November 16, 2011, 06:04:17 AM »
This isn't considered a redirect. You're essentially trying to initiate a new HTTP request to an external source and to make it more interesting, over SSL. I look forward to seeing how to do this.

Offline evildani

  • Administrator
  • Hero Member
  • *****
  • Posts: 389
  • Karma: 22
Re: Rewrite URL
« Reply #4 on: November 16, 2011, 09:07:36 PM »
Can you describe the flow of requests and responses that you want.

Offline jnor

  • Contributor
  • *
  • Posts: 4
  • Karma: 0
Re: Rewrite URL
« Reply #5 on: November 18, 2011, 04:25:26 AM »
When a customer goes to e.g https://www.internal.com/test/test.aspx then I want to point them to  https://www.external.com/test/test.aspx without rewriting the url in the browser.

The browser will still show https://www.internal.com/test/test.aspx but the content will be presented from  https://www.external.com/test/test.aspx.

Sorry I can't explain it in a better way. I don't even know if its possible.



Offline evildani

  • Administrator
  • Hero Member
  • *****
  • Posts: 389
  • Karma: 22
Re: Rewrite URL
« Reply #6 on: November 19, 2011, 06:54:55 PM »
What you want is a man in the middle, this can only be done if you control the two DNS records and both sites are being balanced by the Netscaler, otherwise the browser will detect the SSL error.
Its doable under certain conditions.

Offline cript2000

  • Contributor
  • *
  • Posts: 8
  • Karma: 0
Re: Rewrite URL
« Reply #7 on: November 19, 2011, 07:31:13 PM »
What you want is a man in the middle, this can only be done if you control the two DNS records and both sites are being balanced by the Netscaler, otherwise the browser will detect the SSL error.
Its doable under certain conditions.

If Netscaler is a full proxy, this shouldn't be true. Netscaler should be able to request data from the external site and respond to the client's request with that data.

Offline pbertain

  • Contributor
  • *
  • Posts: 1
  • Karma: 1
Re: Rewrite URL
« Reply #8 on: November 19, 2011, 11:43:59 PM »
This would work fairly easily with HTTP traffic.  The issue might arise from SSL, though.  As long as you have your own SSL cert, it might work because the Netscaler won't care about the backend (external) ssl cert.  What you could try is to add the remote (external site) as a service and bind it to the local (internal site) vserver.

add server remote-server 1.2.3.4
add service remote-server:443 remote-server ssl 443
add lb vserver local-server:443 ssl 10.0.0.1 443
bind lb vserver local-server:443 remote-server:443
bind ssl vserver local-server:443 -certkeyName local-server.cert

It works with my testing for HTTP (port 80) but using google as a remote service, it rewrote the url from their end.