From 66eb92382c0d73d79a5e8862f5b6b36b64e415a1 Mon Sep 17 00:00:00 2001 From: Will Harding Date: Thu, 7 Jan 2016 11:43:36 -0800 Subject: [PATCH] Add angular redirect for links - Fixes 404 errors for kakwa redirects - Links to same domain (eg: avalanche.ca) use client side routing so nginx redirects dont apply. Added kakwa reriect mirror to make blog links work --- client/app/avalanchecanada/redirect/redirect.js | 13 +++++++++++++ client/index.html | 1 + proxy.conf | 5 +++++ 3 files changed, 19 insertions(+) create mode 100644 client/app/avalanchecanada/redirect/redirect.js diff --git a/client/app/avalanchecanada/redirect/redirect.js b/client/app/avalanchecanada/redirect/redirect.js new file mode 100644 index 000000000..7ca45cd90 --- /dev/null +++ b/client/app/avalanchecanada/redirect/redirect.js @@ -0,0 +1,13 @@ + +'use strict'; + +angular.module('avalancheCanadaApp') +.config(function ($stateProvider) { + $stateProvider + .state('ac.redirectKakwa', { + url: '^/kakwa', + controller: function($window) { + $window.location.href = 'http://www.yukonavalanche.ca/wx/weatherCAC.php?station=CACKAK'; + } + }); + }); diff --git a/client/index.html b/client/index.html index f284ecfbc..41e34bb96 100644 --- a/client/index.html +++ b/client/index.html @@ -145,6 +145,7 @@ + diff --git a/proxy.conf b/proxy.conf index a394daebc..952c07f99 100644 --- a/proxy.conf +++ b/proxy.conf @@ -23,6 +23,8 @@ server { } location /cherry-bowl { + rewrite /cherry-bowl/$ /index.html break; + rewrite /cherry-bowl$ /index.html break; rewrite /cherry-bowl/(.*) /$1 break; proxy_pass https://cherry-bowl.s3.amazonaws.com; } @@ -42,6 +44,9 @@ server { location /caf{ return 301 http://www.avalanche.ca/foundation; } + location /kakwa{ + return 301 http://www.yukonavalanche.ca/wx/weatherCAC.php?station=CACKAK; + } location /cac/about/(media|careers){ return 410;