Forum Discussion
Dave_Horsey_225
Nimbostratus
Mar 10, 2006Rewrite URL and change pool trouble
I have been working on a irule to rewrite the URL to do the following:
User sends http://www.sitename.com/blog
bigip changes the url to http://blog.sitename.com/ and redirects the ...
Mar 14, 2006
That's odd. I just cut+pasted from the post on v9.2.2 and it loaded fine. I'd try to remove all trailing spaces from your lines and see if that fixes it. As for the substitution, here's a go at it.
when HTTP_REQUEST {
if { ([HTTP::uri] starts_with "/blog") and
!([HTTP::uri] starts_with "/blogs/menapauseinsightblog") } {
HTTP::uri "/blogs/menapauseinsightblog[string range [HTTP::uri] 5 end]"
}
}This will replace all uris that start with "/blog" but don't start with "/blogs/menapauseinsightblog" with the new uri appended with character 6 to the end of the original uri.
Keep in mind that this will blanketly replace the strings as such
/blog?user=foo => /blogs/menapauseinsightblog?user=foo
/blogs?user=foo => /blogs/menapauseinsightblogs?user=foo
/bloggin?user=foo => /blogs/menapauseinsightblogsgin?user=foo
Just keep that in mind...
-Joe
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
