Discover Centmin Mod today
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

    45,703
    10,377
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,103
    Local Time:
    7:34 PM
    Nginx 1.19.x
    MariaDB 5.5/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

    45,703
    10,377
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,103
    Local Time:
    7:34 PM
    Nginx 1.19.x
    MariaDB 5.5/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