Forum Discussion
Rewrite the content in URI with a short URL
- Jun 12, 2014
I am unable to update my original post. Here is an updated version.
If you simply want to mask URL's then apply a STREAM profile with the following iRule.
when HTTP_REQUEST { log local0. "..in HTTP_REQUEST" no replacement for requests STREAM::disable disable compression server side HTTP::header remove "Accept-Encoding" } when HTTP_RESPONSE { log local0. "...in HTTP_RESPONSE" only replace text content if {!([HTTP::header value Content-Type] contains "text")}{ return} set search "" foreach pair [class get myclass] { set search "$search@[lindex $pair 0]@[lindex $pair 1]@" } log local0. "String replace=$search" STREAM::expression $search STREAM::enable }
Then create a string data class myclass as follows...
Name Value /secureapp/connect/report_en/REP /en /peter /pan
And get the following output from a logs
Rule /Common/myrule : ...in HTTP_REQUEST Rule /Common/myrule : ...in HTTP_RESPONSE Rule /Common/myrule : search=@/secureapp/connect/report_en/REP@/en@@/peter@/pan@
And the resulting web page...
It works! /en /pan
The above is not working . I configured the above iRule and assigned it to VS along with enabling stream. I have built a dummy URL on the backened webserver and when i browse this URL , the URL in the address bar remains unchanged
i understand Kevin's irule does replace string (e.g. uri) in response from server. it does not affect if you browse the uri directly.
Source URL : http://www.myweb.com/secureapp/connect/report_en/REP/XYZ
Masked URL : http://www.myweb.com/en/XYZ
do you want when browsing http://www.myweb.com/secureapp/connect/report_en/REP/XYZ, url in address bar is changed to http://www.myweb.com/en/XYZ but uri to server is still /secureapp/connect/report_en/REP/XYZ?
or does user have to browse http://www.myweb.com/en/XYZ (http://www.myweb.com/secureapp/connect/report_en/REP/XYZ is no not available at all) but bigip changes uri when sending to server to /secureapp/connect/report_en/REP/XYZ?
Recent Discussions
Related Content
* 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