Forum Discussion
PacketHead_4009
Nimbostratus
Nov 04, 2010URI Redirect to main page
Hello,
I have a few iRules that do something similar to what I am looking for but not specifically what I am trying to do.
Basically I have a VIP for www.mysite.com. I have some old links that no longer work due to content change and upgrades but users have these links stored as favorties and in their system (i.e. www.mysite.com/user/manpage/home and www.mysite.com/admins/manpage/tools )
I want to create an iRule to redirect the users back to the main page if they have any of the URLs listed above. This seems simple enough with some if and else statements but I'm still new to iRule coding.
Any help would be appreciated!
- James
- George_Watkins_Historic F5 AccountHi James,
when HTTP_REQUEST { switch -glob [HTTP::path] { "/user/manpage/home/*" - "/admins/manpage/tools/*" - default { HTTP::redirect http://www.mysite.com } } }
- PacketHead_4009
Nimbostratus
Hello George, - George_Watkins_Historic F5 AccountHi James,
when HTTP_REQUEST { switch -glob [HTTP::path] { "/admins/manpage/tools/*" { HTTP::redirect http://www.mysite.com/tools/new } "/user/manpage/home/*" - default { HTTP::redirect http://www.mysite.com } } }
- PacketHead_4009
Nimbostratus
Ok, let me take a step back. Looks like it is looping. So my main VIP/site is www.mysite.com - George_Watkins_Historic F5 AccountI don't know why you are getting stuck in a redirect loop. My first guess would be that you are also redirecting at the web server. The iRule itself should not be putting you in a redirect loop.
- hoolio
Cirrostratus
If /user/manpage/home/homesite.htm references any other objects like css, images, etc, then you'll get a loop. At a minimum, you'd want to allow (not redirect) that URI and any URIs it references.
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