Forum Discussion
Kapil_Sharma_61
Nimbostratus
Sep 14, 2005HTTP Response
Hi,
I am trying to add a prefix to the URI before sending the response to the client.
For example, the server responds with the URI /sample/page.html
and I want to send to the client /...
Brian_Gupta_115
Nimbostratus
Sep 20, 2005You are going to need to use the findstring to extract a substing of the URI. (I wish there was a URI::shift method)Click here to see the following article for an explanation of findstring:
http://devcentral.f5.com/Default.aspx?tabid=29&articleType=ArticleView&articleId=33
when HTTP_REQUEST {
set my_uri [HTTP::uri]
if { $my_uri starts_with "/test/" } {
log $my_uri
set stringtostrip [getfield [HTTP::uri] / 1]
log $stringtostrip
set new_uri [findstring [ [HTTP::uri] ] $stringtostrip]
log $new_uri
set rewrite_uri [HTTP::host]$new_uri
log $rewrite_uri
HTTP::uri $rewrite_uri
}
}
}
when SERVER_CONNECTED {
if { $usessl == 0 } {
SSL::disable
}
}Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects