Skip to content

Commit

Permalink
Redirects: Temporarily redirect w.org/playground to the correct locat…
Browse files Browse the repository at this point in the history
…ion.

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 WordPress/wporg-main-2022#355


git-svn-id: https://meta.svn.wordpress.org/sites/trunk@13050 74240141-8908-4e6f-9713-ba540dce6ec7
  • Loading branch information
dd32 committed Dec 12, 2023
1 parent c2bbd0c commit c93e8c0
Showing 1 changed file with 9 additions and 1 deletion.
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit c93e8c0

Please sign in to comment.