Forum Discussion
slomah_85788
Nimbostratus
Jun 10, 2009Appending iRule
Hi,
I have requested to create iRule which will add appending to url, as the customer will write (http://mycompany.com ) and the application won’t work unless you write the following (http://mycompany.com/test/app.aspx )
1) I created the following irule but the pictures on the page doesn’t appear
when HTTP_REQUEST {
if { not ([HTTP::uri] starts_with "/test") } {
HTTP::uri /test/app.aspx [HTTP::uri]
}
}
2) I used redirection irule like this and it works but I don’t know if this will affect the application
when HTTP_REQUEST {
if {
[HTTP::uri] equals "" or [HTTP::uri] equals "/" } {
HTTP::redirect http://mycompany.com/test/app.aspx }}
I would like if someone help me in No.1 to make work.
5 Replies
Sort By
- For the first iRule, let's say your incoming URI is "/foobar". You are resetting the URI to the "/test/app.aspx /foobar". I'm assuming that isn't what you want to do. If you just want to change the URI to /test/app.aspx" then leave out your trailing [HTTP::uri] from the assignment.
- slomah_85788
Nimbostratus
- hoolio
Cirrostratus
If you just want to rewrite requests to the root document (path equals /), you could use this:when HTTP_REQUEST { Check if path is / if {[HTTP::path] eq "/"}{ Rewrite path to /test/app.aspx HTTP::path "/test/app.aspx" } }
when HTTP_REQUEST { Check if path doesn't already start with /test/ if { not ([HTTP::path] starts_with "/test/")}{ Rewrite path by prepending "/test/" HTTP::path "/test/[HTTP::path]" } }
- Matt_108113
Nimbostratus
All, - hoolio
Cirrostratus
Hi Matt,
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