Welcome to Centmin Mod Community
Register Now

Wordpress Cache-Enabler Plugin Caching search results with standard centminmod install ?

Discussion in 'Blogs & CMS usage' started by julliuz, Jul 16, 2020.

  1. eva2000

    eva2000 Administrator Staff Member

    50,473
    11,662
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,084
    Local Time:
    8:49 AM
    Nginx 1.25.x
    MariaDB 10.x
    unfortunately no as I don't have WPML to test problem is the query string for
    Code (Text):
    https://domain.com/ar/?s=s
    

    is redirected by the 302 functions.php code to
    Code (Text):
    https://domain.com/search/s/
    

    and ignoring /ar part. Might need to ask WPML what function.php code changes for below code are needed to make it work with WPML language url paths like /ar/?s=s to maybe something like /search/ar/searchterm/
    PHP:
    function wpb_change_search_url() {
      if ( 
    is_search() && ! empty( $_GET['s'] ) ) {
        
    wp_redirecthome_url"/search/" ) . urlencodeget_query_var's' ) ) . "/");
        exit();
      }
    }
    add_action'template_redirect''wpb_change_search_url' );


     
  2. eva2000

    eva2000 Administrator Staff Member

    50,473
    11,662
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,084
    Local Time:
    8:49 AM
    Nginx 1.25.x
    MariaDB 10.x
    FYI, no longer needed as Cache Enabler 1.5.1 caches all query strings by default Beta Branch - update centmin.sh option 22 Cache Enabler 1.5.1+ support in 123.09beta01 which can be problematic for wp plugins that use query strings as you now need to exclude query strings in Cache Enabler problem with JS wordfence