Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

ACE Redirect

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:


Thanks in advance for any and all replies.

Cisco Employee

Re: ACE Redirect


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


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

rserver redirect redirect-sf
  webhost-redirection 301


This link explains more on Configuring Real Server Relocation String,

Hope this helps,

Best Regards,

New Member

Re: ACE Redirect

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 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.

Cisco Employee

Re: ACE Redirect


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:" then ACE can rewrite this header to

"Location:" .

Hope this helps.

Best Regards,


New Member

Re: ACE Redirect

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.