ACE Redirect

Unanswered Question
Dec 10th, 2009

With the ACE module or appliance can somebody point me to the best method for redirecting a url to a new url, removing a directory structure. It should look something like this and would be a permanent move (http 301):

Old url: http://oldsite.company.net/foldername/filename.ext

Redirect: http://newsite.company.net/filename.ext

Thanks in advance for any and all replies.

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
rvavale Thu, 12/10/2009 - 18:44

Hi,

For ACE to redirect, you need to configure serverfarm and rserver of type redirect.

With below config, for request hitting VIP and has "/foldername/filename\.ext" , ACE will sent 301 Redirect url as
"http://newsite.company.net/filename.ext"

--------------------------------------------------------------------------------------------

class-map type http loadbalance match-any redirect-l7
  2 match http url /foldername/filename\.ext.*

policy-map type loadbalance first-match redirect-policy
  class redirect-l7
    serverfarm redirect-sf

serverfarm redirect redirect-sf
  rserver redirect-sf
    inservice

rserver redirect redirect-sf
  webhost-redirection http://newsite.company.net/filename.ext 301
  inservice

--------------------------------------------------------------------------------------------


This link explains more on Configuring Real Server Relocation String,
http://www.cisco.com/en/US/docs/interfaces_modules/services_modules/ace/v3.00_A2/configuration/slb/guide/rsfarms.html#wp1013201


Hope this helps,

Best Regards,
Rahul

aanelso1 Mon, 12/14/2009 - 08:07

The reply works, but not like our requirements need.

What we need is to preserve the filename (as it will not change in the redirect string), but drop the directory name. We have about 900 video files that were set up on 20 different channels. These video names will not change, however, the channels are going away.

So, back to my initial question....

I know that %h = host name and %p equals the uri for the web-host redirection string. But there is not a variable for just the file name as far as I know.

There may be a way to rewrite the header, but I am fairly new to the ACE (currently working on replacing all of our existing CSSs and CSMs with ACEs).

I think that the class-map for matching the inbound request is correct....it is just the web-host redirection string that I want to minimize.

If I have to have a class-map match and unique web-host redirection for all 900 files, that will be huge, not to mention the resources that could be consumed by querying all of those matches.

Thanks for your quick reply.

rvavale Mon, 12/14/2009 - 21:46

Hi,

Thats correct, at the moment there isn't a variable to match on specific path in the URL. "%p" matches on entire path string after the first "/".

So configuring "%p" won't help as it will include entire path.

On ACE you can configure Action-list to rewrite header in Server response. However it won't be possible for ACE to rewrite header for 301 response generated by its own "redirect rserver".

Maybe you might want to do initial redirect on Server and then configure ACE to Rewrite Location Header before forwarding it to Client.

So if Real Server replies with 301 Response "Location: http://newsite.company.net/foldername/filename.ext" then ACE can rewrite this header to

"Location: http://newsite.company.net/filename.ext" .

Hope this helps.

Best Regards,

Rahul

aanelso1 Tue, 12/15/2009 - 04:39

Thanks again for your reply.

I was able to accomplish what we are looking for using Microsoft IIS server. Their redirect has multiple variables, including $S which represents the filename only.

Thanks again.

Actions

This Discussion