Forum Discussion
MikeM_44778
Nimbostratus
Jan 16, 2007Rewrite URL Context
How would I go about rewriting the following URL:
http://www.testsite.com/scripts/org.test.dispatch?app=uservariable
to go to
http://www.testsite.com/webapps/newsite/org.test....
JRahm
Admin
Jan 16, 2007In its simplest form with no error-checking:
when HTTP_REQUEST {
HTTP::uri "/webapps/newsite/[findstr [HTTP::uri] "/scripts/" 9]"
}
I'd build some protection around this if your scope is beyond testing functionality, perhaps verify the path begins correctly:
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/scripts/" } {
HTTP::uri "/webapps/newsite/[findstr [string tolower [HTTP::uri]] "/scripts/" 9]"
}
}
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