Skip to content

Commit 7d88491

Browse files
authored
Website: Add nice redirects for the new docs site (#1681)
This the following redirections as per @juanmaguitar request: * from https://playground.wordpress.net/builder to https://playground.wordpress.net/builder/builder.html * from https://playground.wordpress.net/wordpress to https://playground.wordpress.net/wordpress.html * from https://playground.wordpress.net/gutenberg to https://playground.wordpress.net/gutenberg.html * from https://playground.wordpress.net/proxy to https://github-proxy.com/ In this way it would become easier to access (and remember) some of the tools related to Playground: * https://playground.wordpress.net/ → Playground instance * https://playground.wordpress.net /docs → Playground Docs (redirection already active) * https://playground.wordpress.net /builder → Playground Blueprints Builder * https://playground.wordpress.net /wordpress → Playground PR viewer for WordPress * https://playground.wordpress.net /gutenberg → Playground PR viewer for Gutenberg * https://playground.wordpress.net /proxy → Playground Proxy Service ## Testing instructions Unfortunately the only way to test is by merging and deploying the website.
1 parent b9a6826 commit 7d88491

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

packages/playground/website-deployment/custom-redirects-lib.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,34 @@ function playground_maybe_redirect( $requested_path ) {
188188
);
189189
}
190190

191+
if ( str_ends_with( $requested_path, '/builder' ) ) {
192+
return array(
193+
'location' => 'https://playground.wordpress.net/builder/builder.html',
194+
'status' => 301
195+
);
196+
}
197+
198+
if ( str_ends_with( $requested_path, '/wordpress' ) ) {
199+
return array(
200+
'location' => 'https://playground.wordpress.net/wordpress.html',
201+
'status' => 301
202+
);
203+
}
204+
205+
if ( str_ends_with( $requested_path, '/gutenberg' ) ) {
206+
return array(
207+
'location' => 'https://playground.wordpress.net/gutenberg.html',
208+
'status' => 301
209+
);
210+
}
211+
212+
if ( str_ends_with( $requested_path, '/proxy' ) ) {
213+
return array(
214+
'location' => 'https://github-proxy.com/',
215+
'status' => 301
216+
);
217+
}
218+
191219
if ( str_ends_with( $requested_path, '/wordpress-browser.html' ) ) {
192220
return array(
193221
'location' => '/',

0 commit comments

Comments
 (0)