Forum Discussion
Hide/Mask URL using iRule
I would like to mask my home page URL path via an iRule condition because currently when a user navigate to my domain (http://www.mysite.com), it is redirected to an MCMS server base content (http://www.mysite.com/home/default.htm). I would just like to hide or mask that redirected path via iRule code so when a user navigates to my home page, the address bar will only display my domain URL (http://www.mysite.com).
Illustration:
From:
http://www.mysite.com/home/default.htm
To:
http://www.mysite.com
Can anyone suggests some options I can try?
In addition to this, I would like to ask what is the difference between HTTP::path and HTTP::uri and which of these will best support my objective (masking the URL)
Kindly advice, thanks!
- lmwf1_55268NimbostratusI can help you with one.
- James_Quinby_46Historic F5 Accounttobs -
- AndrewO_4840NimbostratusIf you're only worried about that URI then a simple rule like this would suffice:
when HTTP_REQUEST { if [HTTP::uri == "/"] { HTTP::uri "/home/default.htm" } }
- tobs_93015NimbostratusHi andrewO
- tobs_93015NimbostratusHi lmwf1 and jquinby,
- tobs_93015NimbostratusHi andrewO
- Tosin_OmojolaAltostratus
If I may clarify what AndrewO meant in his reply, he means that the irule would check if the uri IS ( not that it starts with). An irule that checks if the uri STARTS WITH, looks like below:
when HTTP_REQUEST { if [HTTP::uri starts_with "/"] { HTTP::uri "/home/default.htm" } }
but AndrewO actually meant == or eq ( both of which means equal to ).
Now, by "silently rewrites" it means the uri "/" would be replaced with "/home/default.htm" and, yes, that is what your browser will display in its address bar, that is, (http://www.mysite.com/home/default.htm)
Cheers
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