Forum Discussion
Aaron_Magruder_
Nimbostratus
Mar 30, 2005Removing / inserted by iRule variable
Is there a way to prevent the / from being inserted when using variables? The following iRule works to redirect users from /29900 to /Templates/IQuote010.cfm?ID=/29900. I need a way to remove the / ...
Aaron_Magruder_
Nimbostratus
Mar 31, 2005Thanks. This worked like a champ. I think there is a better way to accomplish this but I'm not sure how. The current way I have configured it, I will need to include any new directories in the rule. We would like to look for 5 digits in the uri. If there are only 5, then we would like to redirect to /Templates/.... Everything else would use the pool. This would prevent use from having to add new directories to the rule.
If you have any ideas, let me know.
when HTTP_REQUEST {
set uri [string trimleft [HTTP::uri] "/"]
set host [HTTP::host]
set new_uri /Templates/IQuote010.cfm?ID=
set new_url $host$new_uri$uri
if { [HTTP::uri] starts_with "/Templates" or [HTTP::uri] starts_with "/images" } {
use pool UITShared-172-29-98-77
}
else {
HTTP::redirect http://$new_url
}
}
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