From 52539ee961fb874bb4b38941fafd108613f6c05c Mon Sep 17 00:00:00 2001 From: Isza <91911166+i0sea@users.noreply.github.com> Date: Wed, 27 Sep 2023 15:10:16 -0400 Subject: [PATCH] Don't let Cubic payment URLs get indexed by Google during test phase (#1758) * update robots.txt and hide paths * fix slice indexes * tweak regex * count --- apps/site/assets/static/robots.txt | 4 ++++ apps/site/lib/site_web/templates/layout/app.html.eex | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/site/assets/static/robots.txt b/apps/site/assets/static/robots.txt index 3a504e5efc..6226a813cd 100644 --- a/apps/site/assets/static/robots.txt +++ b/apps/site/assets/static/robots.txt @@ -8,3 +8,7 @@ Disallow: /search?* Disallow: /*?*preview*&vid=* Disallow: /schedules/*/line?*date* Disallow: /org/* +Disallow: /charlie/* +Disallow: /policies/terms-use-charlie* +Disallow: /charlieapp +Disallow: /learnmore-transfer \ No newline at end of file diff --git a/apps/site/lib/site_web/templates/layout/app.html.eex b/apps/site/lib/site_web/templates/layout/app.html.eex index b0ba6b52d4..b16b42b0f0 100644 --- a/apps/site/lib/site_web/templates/layout/app.html.eex +++ b/apps/site/lib/site_web/templates/layout/app.html.eex @@ -18,7 +18,14 @@ if @conn.request_path == "/org" || String.slice(@conn.request_path, 0..4) == "/org/" do %> <% end %> - + <%= # hide any page in /charlie directory from search engines + if @conn.request_path == "/charlie" || String.slice(@conn.request_path, 0..8) == "/charlie/" do %> + + <% end %> + <%= # hide any page in /policies/terms-use-charlie directory from search engines + if @conn.request_path == "/policies/terms-use-charlie" || String.slice(@conn.request_path, 0..26) == "/policies/terms-use-charlie" do %> + + <% end %> <% title = if Phoenix.Controller.view_template(@conn) == "404.html", do: "Page Not Found | MBTA - Massachusetts Bay Transportation Authority", else: title_breadcrumbs(@conn) %> <%= title %> " type="image/png">