Skip to content

Commit 95f92b8

Browse files
committed
Add generic redirect for url formatter support links. (Fixes #1135)
Made-with: Cursor
1 parent f98d858 commit 95f92b8

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

docker/conf/ssl.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ SetEnvIf X-Forwarded-Proto "^https$" HTTPS=on
156156
RewriteRule (.*) https://support.mozilla.org/kb/global-privacy-control [L]
157157
RewriteCond %{REQUEST_URI} ^/thunderbird/([^/]+)/([^/]+)/([^/]+)/how-do-i-turn-do-not-track-feature$
158158
RewriteRule (.*) https://support.mozilla.org/kb/how-do-i-turn-do-not-track-feature [L]
159+
# Rewrite for desktop support links https://github.com/thunderbird/thunderbird-website/issues/1135
160+
# Pattern: /thunderbird/%1(version)/%2(os)/%3(locale)/%4(slug)
161+
RewriteCond %{REQUEST_URI} ^/thunderbird/([^/]+)/([^/]+)/([^/]+)/(.+)$
162+
RewriteRule .* https://support.mozilla.org/%3/kb/%4 [R=302,L]
159163
RewriteCond %{REQUEST_URI} ^/kb/ask$
160164
RewriteRule (.*) https://support.mozilla.org/en-US/questions/new/thunderbird [L]
161165
RewriteCond %{REQUEST_URI} ^/([^/]+)/kb/ask$

tests/test_webserver.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,17 @@ def get(path: str, host: str, accept_language: str = "en-US") -> requests.Respon
9191
("tb.pro", "/send", 302, "/en-US/send"),
9292
("tb.pro", "/thundermail", 302, "/en-US/thundermail"),
9393
("tb.pro", "/waitlist", 302, "/en-US/waitlist"),
94+
95+
# support.thunderbird.net - generic url formatter redirects (issue #1135)
96+
("support.thunderbird.net", "/thunderbird/147.0.2/Linux/en-US/quarantined-domains", 302, "support.mozilla.org/en-US/kb/quarantined-domains"),
97+
("support.thunderbird.net", "/thunderbird/147.0.2/Linux/en-US/experiment-add-on-support", 302, "support.mozilla.org/en-US/kb/experiment-add-on-support"),
98+
("support.thunderbird.net", "/thunderbird/128.0/Windows_NT/de/some-article", 302, "support.mozilla.org/de/kb/some-article"),
99+
("support.thunderbird.net", "/thunderbird/140.0.1/Darwin/fr/some-article", 302, "support.mozilla.org/fr/kb/some-article"),
100+
101+
# support.thunderbird.net - custom slug overrides take precedence
102+
("support.thunderbird.net", "/thunderbird/147.0.2/Linux/en-US/extension-permissions", 302, "support.mozilla.org/kb/permission-request-messages-thunderbird-extensions"),
103+
("support.thunderbird.net", "/thunderbird/147.0.2/Linux/en-US/cant-remove-addon", 302, "support.mozilla.org/kb/policies-extensions-locked"),
104+
("support.thunderbird.net", "/thunderbird/147.0.2/Linux/en-US/addons-help", 302, "support.mozilla.org/kb/thunderbird-add-ons-frequently-asked-questions"),
94105
]
95106

96107

0 commit comments

Comments
 (0)