Forum Discussion
Appending the URI to the incoming request
Hi Guys,
I hope someone must have had a similar requirement and may help me quickly.... I have a web server which is accessible by typing "company.service1.com/xx/yyy" . I want the users to type in their browser only "company.service1.com" can someone help me with an irule that can add this "/xx/yyy" to the incoming request to avoid the users from typing all of that.
Regards,
14 Replies
- IheartF5_45022
Nacreous
Either;
when HTTP_REQUEST { if {[HTTP::path] eq "/" } { This will give you a 'stealth' change of path HTTP::uri "/xx/yyy" } }or
when HTTP_REQUEST { if {[HTTP::path] eq "/" } { This will show the change of path in the users browser HTTP::response 301 Location "http://company.service1.com/xx/yyy" return } } - Techgeeeg
Nimbostratus
Thank IheartF5
I have one more query this iRule when attached to the Virtual Server will only be invoked during the initial URL request only m i correct? and it will not disturb the further requests or it will try to intercept every request?
Regards,
- IheartF5_45022
Nacreous
The HTTP_REQUEST event and iRule will be triggered for every request, but the
if {[HTTP::path] eq "/" } {ensures that the redirect or path rewrite will only be executed when the request is for "/"
- Techgeeeg
Nimbostratus
Thanks Iheart....
After putting the iRule I am feeling a bit of slowness in response and the page load times where as if I was typing the complete path it was fast.... any suggestions... ??
Regards,
- IheartF5_45022
Nacreous
Which version did you use - redirect or rewrite?
- Techgeeeg_28888
Nimbostratus
I have used this one.
when HTTP_REQUEST { if {[HTTP::path] eq "/" } { This will give you a 'stealth' change of path HTTP::uri "/xx/yyy" } }- Arie
Altostratus
This works only if the client doesn't use the actual file name of the home page. If the home page ever does a postback this is guaranteed to be an issue, but I'd also be weary of users who tack it onto their original request. You may want to check for that (e.g. index.html, default.aspx).
- Techgeeeg
Nimbostratus
I have used this one.
when HTTP_REQUEST { if {[HTTP::path] eq "/" } { This will give you a 'stealth' change of path HTTP::uri "/xx/yyy" } }- Arie
Altostratus
This works only if the client doesn't use the actual file name of the home page. If the home page ever does a postback this is guaranteed to be an issue, but I'd also be weary of users who tack it onto their original request. You may want to check for that (e.g. index.html, default.aspx).
- IheartF5_45022
Nacreous
There's no reason at all that this should cause a performance issue of any sort. Are you sure something else hasn't changed that affects the page load?
- Techgeeeg
Nimbostratus
Yes I am sure nothing else has changed when i write the complete URL it comes up very fast when i write incomplete and depend on the Irule to change it it's taking time.
- Techgeeeg
Nimbostratus
One more thing guys.... this was a https website now I want to create a http VS and write an irule that if someone types in "http://company.service1.com" the irule should redirect the user to "https://company.service1.com/xx/yyy" what changes shall i make to the above irule
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