Forum Discussion
Joe_5599_134300
Nimbostratus
Oct 02, 2013Best way to add URI at end of URL
What would be the best way with an irule to append /mobile/cplogin.aspx to a default URL of https://testsiteone@xyz.com Basically need users redirected to https://testsiteone@xyz.com/mobile/cplogin.aspx
Thanks Joe
6 Replies
- Dennis_Andrade_
Nimbostratus
You can use the following irule to do that:
when HTTP_REQUEST { HTTP::redirect https://[HTTP::host]/mobile/cplogin.aspx } - What_Lies_Bene1
Cirrostratus
Are you sure about that '@'? Anyway, assuming it should be a period '.';
when HTTP_REQUEST { if { [HTTP::uri]] equals "/" } { HTTP::redirect https://[[HTTP::host]]/mobile/cplogin.aspx } } - Kevin_Stewart
Employee
Try this:
when HTTP_REQUEST { if { [HTTP::uri] equals "/" } { HTTP::redirect "https://[HTTP::host]/mobile/cplogin.aspx" } }Do you specifically mean "testsiteone@xyz.com", with an ampersand in the URL?
- Joe_5599_134300
Nimbostratus
I meant https://testsiteone.xyz.com/mobile/cplogin.aspx - Joe_5599_134300
Nimbostratus
When would you use this if { [HTTP::uri] == "/" - Kevin_Stewart
Employee
This essentially means "if the URI is blank (you didn't enter a URI in the request), the redirect to the /mobile URI". If you don't specify a URI in the request, it will always at the very least equal "/". You need a conditional check like this to prevent a loop.
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