# URL Switching / Stripping with aFleX and Switch

**URL:** <https://community.a10networks.com/t/url-switching-stripping-with-aflex-and-switch/133>\
**Category:** aFleX\
**Created:** [December 12, 2011, 2:46am UTC](https://community.a10networks.com/t/url-switching-stripping-with-aflex-and-switch/133 "2011-12-12T02:46:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mischa](https://avatars.discourse-cdn.com/v4/letter/m/b9bd4f/32.png) [@mischa](https://community.a10networks.com/u/mischa)\
**Post date:** [December 12, 2011, 2:46am UTC](https://community.a10networks.com/t/url-switching-stripping-with-aflex-and-switch/133/1 "2011-12-12T02:46:47Z")

</div>

**Posted by mischa**  **Code:**

* * *

`when HTTP_REQUEST { HTTP::header insert X-Real-IP [IP::client_addr] switch -glob [HTTP::uri] { "/specific_url*" { HTTP::respond 301 Location "http://[INSERT YOUR URL HERE] } "/images*" { regsub -all "/images/?" [HTTP::uri] "/" newuri HTTP::uri $newuri pool pool_images } "/static/0*" { regsub -all "/static/0/?" [HTTP::uri] "/" newuri HTTP::uri $newuri pool pool0 } "/static/1*" { regsub -all "/static/1/?" [HTTP::uri] "/" newuri HTTP::uri $newuri pool pool1 } "/static/2*" { regsub -all "/static/2/?" [HTTP::uri] "/" newuri HTTP::uri $newuri pool pool2 } } }`

* * *
