ACE URL Rewrite

Answered Question
Nov 1st, 2008
User Badges:

Hi Guys,


Just need to know if I'm correct but I'm trying to setup a HTTP Rewarite for a hostname. I.E if a user addressed http://test.joebloggs.com and i wanted it to redirect to http://test1.joebloggs.com can this function do that?

If so I have tried but doesn't seem to work see my action list line;


action-list type modify http PoC_APPS_HTTP_Mod

header rewrite both location header-value "http://test" replace "http://apps"


a little new to ACE so this is a POC test.


Regards

Matt


Correct Answer by Gilles Dufour about 8 years 8 months ago


Here is the correct way to do it:


action-list type modify http RewriteHost

header rewrite request Host header-value "test(.*)" replace "apps%1"


Be aware that does not redirect the user to apps. It just forwards the request to the test server with the host field rewritten in the http header.


If you want a redirect to a different server, you need to create a redirect service which will send a 302 redirect to the client forcing a new connection to be open to apps....



Gilles.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (2 ratings)
Loading.
Correct Answer
Gilles Dufour Tue, 11/04/2008 - 05:47
User Badges:
  • Cisco Employee,


Here is the correct way to do it:


action-list type modify http RewriteHost

header rewrite request Host header-value "test(.*)" replace "apps%1"


Be aware that does not redirect the user to apps. It just forwards the request to the test server with the host field rewritten in the http header.


If you want a redirect to a different server, you need to create a redirect service which will send a 302 redirect to the client forcing a new connection to be open to apps....



Gilles.

dknoezinger Tue, 02/03/2009 - 01:15
User Badges:

Hi Gilles,


I have a question concerning that matter:

How about Rewriting not just the Host part of the Request but the GET part, as well?

I tried that on the ace but failed - all I am able to rewrite is the HOST part.


Here is what I tried to do:


action-list type modify http URL_REWRITE

header rewrite request Host header-value "www(.*)" replace "www19%1"

header rewrite request GET header-value "/de/(.*)$" replace "/en/%1"


While the upper Rewrite of the HOST www to www19 worked fine, the Rewrite of the GET part did not work.

I also tried to just put the Rewrite of GET part alone inside, but did not work, either.


Hope anyone can clarify this...


Thanks and best regards,

Daniel

Gilles Dufour Tue, 02/03/2009 - 01:57
User Badges:
  • Cisco Employee,

You can't modify the url.

If you want to do so, you have to do a redirect which will force the web browser to send the correct url.


Gilles.

dknoezinger Tue, 02/03/2009 - 02:07
User Badges:

Hi Gilles,


thanks for the information. is that not possible in general or is it just not implemented, yet?


do you know anything about ACE and ssl/tls server name indication (sni)? need that to be able to migrate the ssl termination from apache servers to the ace - but could not find anything about that...


thanks and best regards,

daniel

Gilles Dufour Tue, 02/03/2009 - 05:32
User Badges:
  • Cisco Employee,

It has never been possible to change the URL with a Cisco loadbalancer.

Design decision as obviously this should be possible.


I don't think there is any plan to support the modification of the url.


We do not support SNI currently.

I'll check if there is any plan for it.


Thanks,


Gilles.

Gilles Dufour Wed, 02/04/2009 - 05:43
User Badges:
  • Cisco Employee,

Daniel,


there is currently no plan.

I'm pushing hard to get it added because I think it is really useful.


If you could ask your Cisco contact to introduce an official request to the Product Manager, that can help move faster.


Tx.


Gilles.

dknoezinger Wed, 02/04/2009 - 05:54
User Badges:

Hi Gilles,


Thanks a lot for that clarification - that helps me a lot. I'll talk to the Austrian account team in case the customer insists on it.


Best regards,

Daniel

bogdan.badiu Tue, 11/09/2010 - 08:22
User Badges:

Hello, Any news on that URL Rewrite support on ACE?

I really do not understand why is missing


Bogdan

Actions

This Discussion