WordPress.org

Making WordPress.org

Changeset 7788


Ignore:
Timestamp:
10/27/2018 05:38:23 AM (15 months ago)
Author:
SergeyBiryukov
Message:

Plugin Directory: Use 301 status code for search redirects.

Props jonoaldersonwp.
Fixes #3851.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php

    r7600 r7788  
    11801180        // If it's an old search query, handle that too.
    11811181        if ( 'search.php' == get_query_var( 'name' ) && isset( $_GET['q'] ) ) {
    1182             wp_safe_redirect( site_url( '/search/' . urlencode( wp_unslash( $_GET['q'] ) ) . '/' ) );
     1182            wp_safe_redirect( site_url( '/search/' . urlencode( wp_unslash( $_GET['q'] ) ) . '/' ), 301 );
    11831183            die();
    11841184        }
     
    11861186        // new-style Search links.
    11871187        if ( get_query_var( 's' ) && isset( $_GET['s'] ) ) {
    1188             wp_safe_redirect( site_url( '/search/' . urlencode( get_query_var( 's' ) ) . '/' ) );
     1188            wp_safe_redirect( site_url( '/search/' . urlencode( get_query_var( 's' ) ) . '/' ), 301 );
    11891189            die();
    11901190        }
Note: See TracChangeset for help on using the changeset viewer.