F5 is upgrading its customer support chat feature on My.F5.com. Chat support will be unavailable from 6am-10am PST on 1/20/26. Refer to K000159584 for details.

Forum Discussion

johns's avatar
johns
Ret. Employee
Jul 28, 2005

Using URI to rewrite host

I am trying to come up with a rule where the first directory name of the uri is used to rewrite the URL. an example will be:

 

 

http://www.foo.com/abc/doc/index.html =>

 

http://abc.foo.com/abc/doc/index.html.

 

 

I want to make it so that the rule is general enough to be applied to multiple sites like this. I am thinking I will probably have to use regex to parse up to the second "/" after the URL and store that in a variable, then constrcut URL from that. Is that possible?

 

 

Thanks.

25 Replies