Skip to content

Commit

Permalink
Add /release redirect to WP beta/RC blueprint (#1866)
Browse files Browse the repository at this point in the history
## Motivation for the change, related issues

[When sharing blueprint URLs, particularly in chat platforms, the
current long link tends to break due to its length, which affects its
usability.](#1864 (comment))

Closes #1864

## Implementation details

This PR adds a simple redirect to `custom-redirects-lib.php`.

## Testing Instructions (or ideally a Blueprint)

Tested via a stale WP Cloud staging site. It had a
`custom-redirects-lib.php` file that was up-to-date-enough for this.
  • Loading branch information
brandonpayton authored Oct 8, 2024
1 parent 7049e03 commit 804711c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/playground/website-deployment/custom-redirects-lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,20 @@ function playground_maybe_redirect( $requested_path ) {
);
}

if ( $requested_path === '/release' ) {
// Make this redirect relative to `release` in case we implement
// subdir staging for the Playground website.
$redirect_base_path = substr($requested_path, 0, - strlen('release'));
$redirect_location =
$redirect_base_path .
'?blueprint-url=https://raw.githubusercontent.com/wordpress/blueprints/trunk/blueprints/beta-rc/blueprint.json';

return array(
'location' => $redirect_location,
'status' => 301
);
}

if ( str_ends_with( $requested_path, '/wordpress-browser.html' ) ) {
return array(
'location' => '/',
Expand Down

0 comments on commit 804711c

Please sign in to comment.