Forum Discussion
URI rewrite
All,
I am setting up a virtual server for an internal group. They want to be able to go to an address like "http://assetsuite:9080" and be sent to "http://assetsuire:9080/PROD/Domain" The VIP is set up as "performance(HTTP)" and I have written an iRule to do the URI rewrite, but it isn't working...little help?
when HTTP_REQUEST { if { not ([HTTP::uri] == "/PROD/domain") } { HTTP::uri /PROD/domain[HTTP::uri] } }
2 Replies
Hi!
The rule you have would make ie an uri that's "/PROD/domain/mypage.aspx trigger on the if condition.
If you want to make sure all uris starts with /PROD/domain/ you could try this one:
when HTTP_REQUEST { if { not ([HTTP::uri] starts_with "/PROD/domain") } { HTTP::uri /PROD/domain[HTTP::uri] } }This would rewrite /myuri to /PROD/domain/myuri.
Good luck!
/Patrik
- Alanwat_138254
Nimbostratus
That got me on the right track. Some of the page elements weren't loading though, and a httpwatch trace showed me that some of the elements were in a different directory. The following rule worked perfectly.
when HTTP_REQUEST { if { not ([HTTP::uri] starts_with "/PROD") } { HTTP::uri /PROD/domain[HTTP::uri] } }
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