Forum Discussion
Aj_2549
Nimbostratus
Aug 06, 2009Redirect rewrite Help.
Under profile TAB I do see redirect reqrite enabled for one VIP matching all.IF someone bypass this rewrite for specific Ip what irule so we need to configure .
Thanks
Ajay
1 Reply
- hoolio
Cirrostratus
Hi Ajay,
You can determine whether rewrite redirects is enabled on a specific HTTP profile using PROFILE::http redirect_rewrite (Click here), but you cannot modify the configuration using this command. I think you would need to manually implement the rewriting of redirects using an iRule and then not do it for specific IP addresses. There is a Codeshare example from Deb which you could modify to do this:
Rewrite HTTP Redirect Hostname
http://devcentral.f5.com/wiki/default.aspx/iRules/RewriteHTTPRedirectHostname.html
You'd want to change "myold.hostname.com mynew.hostname.com" to "http:// https://" and then add a check of the client IP address using IP::addr (Click here) or matchclass (Click here) in HTTP_RESPONSE:when HTTP_RESPONSE { Check if server response is a redirect and client IP is not 1.1.1.1 if { [HTTP::header is_redirect] and not ([IP::addr [IP::client_addr] equals 1.1.1.1])} { Log original and updated values log local0. "Original Location header value: [HTTP::header value Location],\ updated: [string map -nocase {http:// https://} [HTTP::header value Location]]" Do the update, replacing "http://" with "https://" HTTP::header replace Location [string map -nocase "http:// https://" [HTTP::header value Location]] } }
Aaron
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
