Forum Discussion
Kenny_Van_73892
Nimbostratus
Sep 01, 2006Prevent users access directly to uri from saved favorite
I wonder if someone can help me out, I'm kinda stumple on this and doesn't know where to start.
I have a website that is behind the Big IP v. 4.5.10. Let say the website is https://www.mycompany.com and its uri is /account. At first users have to log in the site, then they can access to their uri. If users save wwww.mycompany.com/account in their browser favorite or bookmark, then next time if they access to the site, it takes them directly to www.mycompany.com/account without getting to www.mycompany.com first and this what I don't want. I want users have to go to www.mycompany.com first even if their saved favorite or bookmark is as www.mycompany.com/account.
Can I write an irule to stop users access directly to www.mycompany.com/account?
Thanks in advance.
- Deb_Allen_18Historic F5 AccountI think the best solution might be to set a session cookie, and redirect on requests for non-root URI's if they don't have it:
when HTTP_REQUEST { if { ([string length [HTTP::uri]] > 1) }{ if { not ([HTTP::cookie exists "SessionCookie"]) }{ HTTP::redirect "http://www.mycompany.com/" } } } when HTTP_RESPONSE { HTTP::cookie insert name "SessionCookie" value [expr { int(1000 * rand()) }] }
- Deb_Allen_18Historic F5 Account(edited previous post to correct cookie insert syntax)
- Kenny_Van_73892
Nimbostratus
Thanks a lot for all your help.
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