Forum Discussion
iRule redirection based on URI
Guys, this redirection based on URI is not working, need some help. I have external Data group text File redirurls with URI in it "/sites/jjtest/Test_Bed/default.aspx",
And iRule - when HTTP_REQUEST { set redirect [class match -value [string tolower [HTTP::uri]] equals redirurls] if {$redirect ne ""} { HTTP::redirect "http://xxxx.ent.xxxxx.com/$redirect" } }
7 Replies
- John_Alam_45640Historic F5 Account
I think you want "class lookup -value"
- gsingh10_135426
Nimbostratus
01070151:3: Rule [/Common/xxxx_redirects] error: line 2: [wrong args] [class lookup -value [string tolower [HTTP::uri]] equals redirurls] Error!
- nathe
Cirrocumulus
You could probably use a HTTP Class profile for this I would've thought.
Your iRule looks ok thought. What happens?
Hope this helps,
N
- gsingh10_135426
Nimbostratus
We have close to 1000 URLS that we need to migrate, and I saw example of scaling these referencing to external file. (text file, type String) with following URI
"/sites/jjtest/Test_Bed/default.aspx",
Redirection is not working.
Any Idea?
- nathe
Cirrocumulus
do you see any more details in the browser, e.g. fidder / http fox? - gsingh10_135426
Nimbostratus
No further details in the browser.
- Kevin_Stewart
Employee
If I may add, you're testing with a [string tolower ] URI value, but the data group entry is not all lowercase, so it will never match. Otherwise your iRule looks okay.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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