Forum Discussion
DanO_100877
Nimbostratus
Mar 25, 2008Does execution halt after http::respond?
I'm trying to set up a series of rules for an upcoming transition of our site to a WCM with wildly different URLs from our old site. What I want to know is if the code stops executing after an http::...
DanO_100877
Nimbostratus
Mar 26, 2008Thanks for the suggestion. That likely wouldn't work properly, however, since the else clause would execute the first time the if clause failed to match, which would almost always be the first iteration of the loop. However, it would work if I just assign a variable in the loop and then redirect to the variable after the loop, so you did give me an idea. Here's what it would look like:
set this_redirect "http://$::base_hostname/site/us/en/home/Global/We-Have-Redesigned-the-Site.html?cid=ErrorPage$page_id"
foreach item $::redirect_ids {
if { $item == $page_id } { set this_redirect "http://$::base_hostname/site/en/us/$item" }
}
HTTP::respond 301 Location $this_redirectSo, you assign the default value prior to the loop and then if any iteration of the loop matches, it re-assigns the new value to the variable. The else clause isn't needed because once you get a match and the value is assigned, the rest of the list can iterate and nothing will happen.
Additionally, isn't HTTP::redirect actually a 302(temporary), rather than a 301(permanent)? We need it to be permanent to ensure proper indexing by Google, etc.
Thanks,
Dan O
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
