Skip to content

Commit 537bbf7

Browse files
authored
chore(fundamental-redirects): add more /docs/ prefix redirects (#11223)
We see a couple of page URLs without /docs/ in our top HTTP 404s list: - /en-US/Media_formats_supported_by_the_audio_and_video_elements - /en-US/JavaScript_typed_arrays/ArrayBuffer - /en-US/JavaScript_typed_arrays/Uint8Array - /en-US/ECMAScript_DontEnum_attribute - /en-US/Using_audio_and_video_in_Firefox
1 parent 47a02e6 commit 537bbf7

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

Diff for: libs/fundamental-redirects/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,7 @@ const MISC_REDIRECT_PATTERNS = [
11621162
// redirects often take over from there, so let's only insert "/docs/"
11631163
// and let any other redirect rules work from that point onwards.
11641164
localeRedirect(
1165-
/^(?<prefix>AJAX|CSS|DOM|DragDrop|HTML|JavaScript|SVG|Tools|Using_files_from_web_applications|Web|XMLHttpRequest|Security)(?<subPath>\/.+?)?\/?$/i,
1165+
/^(?<prefix>AJAX|CSS|DOM|DragDrop|ECMAScript_DontEnum_attribute|HTML|JavaScript|JavaScript_typed_arrays|Media_formats_supported_by_the_audio_and_video_elements|SVG|Tools|Using_audio_and_video_in_Firefox|Using_files_from_web_applications|Web|XMLHttpRequest|Security)(?<subPath>\/.+?)?\/?$/i,
11661166
({ prefix, subPath = "" }) => `/docs/${prefix}${subPath}`,
11671167
{ permanent: true }
11681168
),

Diff for: testing/tests/redirects.test.ts

+16
Original file line numberDiff line numberDiff line change
@@ -1222,15 +1222,27 @@ const MISC_REDIRECT_URLS = [].concat(
12221222
"/en-US/DragDrop/Drag_and_Drop/",
12231223
"/en-US/docs/DragDrop/Drag_and_Drop"
12241224
),
1225+
url_test(
1226+
"/en-US/ECMAScript_DontEnum_attribute",
1227+
"/en-US/docs/ECMAScript_DontEnum_attribute"
1228+
),
12251229
url_test("/en-US/HTML", "/en-US/docs/HTML"),
12261230
url_test("/en-US/HTML/", "/en-US/docs/HTML"),
12271231
url_test("/en-US/HTML/Canvas/", "/en-US/docs/HTML/Canvas"),
12281232
url_test("/en-US/JavaScript", "/en-US/docs/JavaScript"),
12291233
url_test("/en-US/JavaScript/", "/en-US/docs/JavaScript"),
1234+
url_test(
1235+
"/en-US/JavaScript_typed_arrays/ArrayBuffer",
1236+
"/en-US/docs/JavaScript_typed_arrays/ArrayBuffer"
1237+
),
12301238
url_test(
12311239
"/en-US/JavaScript/Reference/About/",
12321240
"/en-US/docs/JavaScript/Reference/About"
12331241
),
1242+
url_test(
1243+
"/en-US/Media_formats_supported_by_the_audio_and_video_elements",
1244+
"/en-US/docs/Media_formats_supported_by_the_audio_and_video_elements"
1245+
),
12341246
url_test("/en-US/SVG", "/en-US/docs/SVG"),
12351247
url_test("/en-US/SVG/", "/en-US/docs/SVG"),
12361248
url_test("/en-US/SVG/Element/font/", "/en-US/docs/SVG/Element/font"),
@@ -1240,6 +1252,10 @@ const MISC_REDIRECT_URLS = [].concat(
12401252
"/en-US/Tools/Memory/Treemap_view/",
12411253
"/en-US/docs/Tools/Memory/Treemap_view"
12421254
),
1255+
url_test(
1256+
"/en-US/Using_audio_and_video_in_Firefox",
1257+
"/en-US/docs/Using_audio_and_video_in_Firefox"
1258+
),
12431259
url_test(
12441260
"/en-US/Using_files_from_web_applications",
12451261
"/en-US/docs/Using_files_from_web_applications"

0 commit comments

Comments
 (0)