From c93e8c0019f015b722cb56ecc1e615c796370748 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Tue, 12 Dec 2023 03:07:20 +0000 Subject: [PATCH] Redirects: Temporarily redirect w.org/playground to the correct location. This is a 302 as the playground will be available at this url directly in the future. See https://wordpress.slack.com/archives/C02QB8GMM/p1702348887775449 See https://github.com/WordPress/wporg-main-2022/issues/355 git-svn-id: https://meta.svn.wordpress.org/sites/trunk@13050 74240141-8908-4e6f-9713-ba540dce6ec7 --- .../wp-content/mu-plugins/pub/wporg-redirects.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-redirects.php b/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-redirects.php index ae735eeeb8..9673b3c49b 100644 --- a/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-redirects.php +++ b/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-redirects.php @@ -56,16 +56,24 @@ // Data Liberation '/and' => '/data-liberation/', + + // Playground, temporarily. + '/playground' => [ 302, 'https://developer.wordpress.org/playground/' ] ]; foreach ( $path_redirects as $test => $redirect ) { if ( 0 === strpos( $_SERVER['REQUEST_URI'], $test ) ) { + $code = 301; + if ( is_array( $redirect ) ) { + list( $code, $redirect ) = $redirect; + } + // override nocache_headers(); header_remove( 'expires' ); header_remove( 'cache-control' ); - wp_safe_redirect( $redirect, 301 ); + wp_safe_redirect( $redirect, $code ); exit; } }