Skip to content

Commit

Permalink
Don't let Cubic payment URLs get indexed by Google during test phase (#…
Browse files Browse the repository at this point in the history
…1758)

* update robots.txt and hide paths

* fix slice indexes

* tweak regex

* count
  • Loading branch information
i0sea authored Sep 27, 2023
1 parent 11d4f72 commit 52539ee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions apps/site/assets/static/robots.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 8 additions & 1 deletion apps/site/lib/site_web/templates/layout/app.html.eex
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@
if @conn.request_path == "/org" || String.slice(@conn.request_path, 0..4) == "/org/" do %>
<meta name="robots" content="noindex, nofollow">
<% end %>

<%= # hide any page in /charlie directory from search engines
if @conn.request_path == "/charlie" || String.slice(@conn.request_path, 0..8) == "/charlie/" do %>
<meta name="robots" content="noindex, nofollow">
<% 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 %>
<meta name="robots" content="noindex, nofollow">
<% end %>
<% title = if Phoenix.Controller.view_template(@conn) == "404.html", do: "Page Not Found | MBTA - Massachusetts Bay Transportation Authority", else: title_breadcrumbs(@conn) %>
<title><%= title %></title>
<link rel="apple-touch-icon" href="<%= static_url(@conn, "/images/mbta-logo-t-180.png") %>" type="image/png">
Expand Down

0 comments on commit 52539ee

Please sign in to comment.