Forum Discussion

DanO_100877's avatar
DanO_100877
Icon for Nimbostratus rankNimbostratus
Mar 25, 2008

Does 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::respond is issued or if I need to explicitly exit the code to prevent it from trying to match any further rules. Here's an example code block:

 

 

foreach item $::redirect_ids {

 

if {$item == $page_id} then {

 

HTTP::respond 301 Location "http://$::base_hostname/site/en/us/$item"

 

}

 

}

 

HTTP::respond 301 Location "http://$::base_hostname/site/us/en/home/Global/We-Have-Redesigned-the-Site.html?cid=ErrorPage$page_id"

 

 

So, I'll have a list of pageids that we want to send to these new pages, but if it doesn't match any of those explicitly redirected ids, just send it to a default error page. If page_id 12345 is in the list, it should do a 301 redirect to our base_hostname, plus the middle URI stuff, plus that same page id as a fake directory. But once it has done that, I don't want it to hit the next line of code that is the default behavior for no matches. Do I need an exit after the http::respond or is that implicit in the respond execution?

 

 

Thanks,

 

 

Dan O

3 Replies

No RepliesBe the first to reply