{exp:stash:parse process="end"} {if {exp:stash:is_empty name="channel_id"} && '{last_segment}'!='amp'}{redirect="404"}{/if} {exp:switchee variable="{last_segment}" parse="inward"} {case value="amp"} {!--redirect old AMP pages to their equivalent regular page--} {if '{segment_1}'=='amp'} {redirect="/"} {if:else} {redirect="{segment_1}{if '{segment_2}'!='amp'}/{segment_2}{/if}{if '{segment_3}'!='amp'}/{segment_3}{/if}"} {/if} {/case} {case default="yes"} {switchee variable="{current_query_string}"} {case value="live=|live=cleared|live=ee-cleared|live=cf-cleared"} {!--stash:embed:global-v4:template-router-speedy--} {stash:embed:global-v4:template-router} {/case} {case default="yes"} {stash:embed:global-v4:template-router} {/case} {/switchee} {/case} {/exp:switchee} {/exp:stash:parse} {exp:stash:set parse_tags="yes" parse_conditionals="yes"} {exp:switchee variable="{last_segment}"} {case value="amp"} {!--do nothing, ensures old AMP URLS don't render a page--} {/case} {case default="yes"} {!-- 1ST CHECK TO SEE IF SEGMENT DATA RETURNS AN ENTRY --} {exp:speedy:fragment key="data-global-sql" ttl="0" tags="{if last_segment}{last_segment}{if:else}homepage{/if}"} {exp:query sql="SELECT * FROM exp_channel_titles WHERE (url_title='{segment_1}-{last_segment}' OR url_title='{segment_2}-{last_segment}' OR url_title='{last_segment}') AND status!='closed' AND status!='Archived' AND status!='To Monetize' AND status!='To Delete' AND (channel_id=72 OR channel_id=73 OR channel_id=88 OR channel_id=141 OR channel_id=71 OR channel_id=116 OR channel_id=77 OR channel_id=98 OR channel_id=26 OR channel_id=109 OR channel_id=86 OR channel_id=113 OR channel_id=12 OR channel_id=84 OR channel_id=74 OR channel_id=134 OR channel_id=139 OR channel_id=142 OR channel_id=164)"} {stash:entry_id}{entry_id}{/stash:entry_id} {stash:title}{title}{/stash:title} {stash:url_title}{url_title}{/stash:url_title} {stash:channel_id}{channel_id}{/stash:channel_id} {stash:status}{status}{/stash:status} {stash:author_id}{author_id}{/stash:author_id} {stash:entry_date}{entry_date format="%m-%d-%Y"}{stash:entry_date} {stash:edit_date}{edit_date format="%m-%d-%Y"}{stash:edit_date} {!-- Determines the section_url & classification_url & type_url to check against Canonical URL for entries--} {exp:stash:embed:partials-v4:section stash:entry_id="{entry_id}"} {exp:stash:embed:partials-v4:classification stash:entry_id="{entry_id}"} {exp:stash:embed:partials-v4:type stash:entry_id="{entry_id}"} {!-- Special case for Entries with 'URL Segment' --} {exp:stash:embed:partials-v4:custom-url stash:entry_id="{entry_id}" stash:channel_id="{channel_id}"} {/exp:query} {/exp:speedy:fragment} {stash:last_segment}{if last_segment}{last_segment}{if:else}homepage{/if}{/stash:last_segment} {/case} {/exp:switchee} {stash:first_segment}{if segment_1}{segment_1}{if:else}homepage{/if}{/stash:first_segment} {if segment_1==''} {stash:channel_id}84{/stash:channel_id} {stash:url_title}homepage{/stash:url_title} {/if}{!--seg_1--} {!--stash:embed:ads-v2:ad-units stash:ad-status="show"--} {/exp:stash:set}