CINXE.COM
<!DOCTYPE html> <html> <body> <script> (function() { function isProduct(value) { return /^[a-z-]+(-c3)?$/.test(value || ''); } function isAttraction(value) { return /^(911memorial|360chicago|[a-z]+)$/.test(value || ''); } function isProductSub(value) { return /^(offers|attractions)$/.test(value || ''); } function productUrl(product) { return "/product/" + product; } function getPathParams() { var path = window.location.pathname; if (path[path.length - 1] === '/') path = path.slice(0, -1); var parts = path.slice(1).split('/'); if (parts.length === 0 || parts.length > 3 || parts[0] !== 'guide') { return { invalid: true }; } return { product: (parts[1] || '').trim().toLowerCase(), attraction: (parts[2] || '').trim().toLowerCase() }; } function getPath() { var params = getPathParams(); var product = params.product; var attraction = params.attraction; var useDefault = params.invalid || window.location.href.indexOf('order_token') !== -1; if (!useDefault) { if (isProduct(product)) { if (isAttraction(attraction)) { return isProductSub(attraction) ? productUrl(product) + "/" + attraction : productUrl(product) + "/attraction/" + attraction; } return productUrl(product); } } return "/welcome"; } function getQueryParams() { var params = window.location.search || ''; var subdomain = window.location.hostname.split('.')[0]; var needsLang = params.indexOf('lang=') === -1; var lang = subdomain && subdomain !== 'www' && /^[a-z]{2}$/.test(subdomain) ? subdomain : ''; if (needsLang && lang) params = params + (params ? '&' : '?') + "lang=" + lang; return params; } function getRedirectUrl() { var appHost = "https://my.citypass.com"; var appPath = getPath(); var appQueryParams = getQueryParams(); return appHost + appPath + appQueryParams + window.location.hash; } window.location.href = getRedirectUrl(); })(); </script> </body> </html>