Making WordPress.org

Changeset 12806


Ignore:
Timestamp:
08/04/2023 04:48:39 AM (12 months ago)
Author:
dd32
Message:

WordPress.org: If for some reason the WordPress.org network is not able to be located (DB/memcache failure, etc) do not perform a 301 redirect to itself.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-redirects.php

    r12476 r12806  
    164164 */
    165165function wporg_redirect_site_not_found() {
    166     // Default location for a not-found site or network is the main WordPress.org homepage.
    167     $location = 'https://wordpress.org/';
    168     $host     = $_SERVER['HTTP_HOST'];
     166    $location = '';
     167    $host     = strtolower( $_SERVER['HTTP_HOST'] );
    169168
    170169    switch ( $host ) {
     
    204203            $location = 'https://developer.wordpress.org/';
    205204            break;
     205
     206        // This should absolutely never happen, exit without a redirect.
     207        case 'wordpress.org':
     208            status_header( 503 );
     209            die( 'WordPress.org is currently unavailable.' );
     210            break;
     211
     212        // Default location for a not-found site or network is the main WordPress.org homepage.
     213        default:
     214            $location = 'https://wordpress.org/';
     215            break;
    206216    }
    207217
Note: See TracChangeset for help on using the changeset viewer.