Skip to content

Commit

Permalink
Add permanent redirect for IAP fr vanity url
Browse files Browse the repository at this point in the history
  • Loading branch information
tristan-orourke committed Mar 15, 2023
1 parent 509a6f5 commit d206924
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
15 changes: 7 additions & 8 deletions infrastructure/conf/nginx-conf-deploy/default
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ server {
location = /en/communities/digital-talent { return 301 https://www.canada.ca/en/government/system/digital-government/gcdigital-community.html; }
location = /fr/communities/digital-talent { return 301 https://www.canada.ca/fr/gouvernement/systeme/gouvernement-numerique/collectivite-gcnumerique.html; }

# permanent redirect within the same domain with relative path
# Permanent redirect within the same domain with relative path
location = /en/talent/search {
absolute_redirect off;
return 301 /en/search;
Expand All @@ -39,6 +39,12 @@ server {
return 301 /fr/search;
}

# Permanent redirect for IAP french vanity url
location = /apprentis-autochtone-ti {
absolute_redirect off;
return 301 /fr/indigenous-it-apprentice;
}

# api
location = /graphql {
fastcgi_pass 127.0.0.1:9000;
Expand Down Expand Up @@ -191,13 +197,6 @@ server {
rewrite "^/indigenous-it-apprentice/(.*\.(png|ico|gif|jpg|jpeg|svg|css|js|pdf|map|webmanifest))$" /apps/web/dist/$1 break;
}

# rewrite possible lang prefix then "apprenti-autochtonne-ti" to web index.html
location ~ "^(?:/[a-z]{2})?/apprenti-autochtonne-ti(/.*|$)" {
add_header Cache-Control no-cache;
expires 0;
rewrite "^(?:/[a-z]{2})?/apprenti-autochtonne-ti(/.*|$)" /apps/web/dist/index.html break;
}

# rewrite possible lang prefix then "indigenous-it-apprentice" to web index.html
location ~ "^(?:/[a-z]{2})?/indigenous-it-apprentice(/.*|$)" {
add_header Cache-Control no-cache;
Expand Down
14 changes: 7 additions & 7 deletions infrastructure/conf/nginx-conf-local/default
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ server {
absolute_redirect off;
return 301 /fr/search;
}

# Permanent redirect for IAP french vanity url
location = /apprentis-autochtone-ti {
absolute_redirect off;
return 301 /fr/indigenous-it-apprentice;
}

# local auth
location ^~ /oxauth {
proxy_pass "http://mock-auth:8080";
Expand Down Expand Up @@ -210,13 +217,6 @@ server {
rewrite "^/indigenous-it-apprentice/(.*\.(png|ico|gif|jpg|jpeg|svg|css|js|pdf|map|webmanifest))$" /apps/web/dist/$1 break;
}

# rewrite possible lang prefix then "apprenti-autochtonne-ti" to web index.html
location ~ "^(?:/[a-z]{2})?/apprenti-autochtonne-ti(/.*|$)" {
add_header Cache-Control no-cache;
expires 0;
rewrite "^(?:/[a-z]{2})?/apprenti-autochtonne-ti(/.*|$)" /apps/web/dist/index.html break;
}

# rewrite possible lang prefix then "indigenous-it-apprentice" to web index.html
location ~ "^(?:/[a-z]{2})?/indigenous-it-apprentice(/.*|$)" {
add_header Cache-Control no-cache;
Expand Down

0 comments on commit d206924

Please sign in to comment.