• Resolved sclosson

    (@sclosson)


    Looking to install this plugin on a Multisite, but it’s running on Nginx instead of apache, so .htaccess rules won’t help here. How would I apply the same rules in nginx that you supply for .htaccess on a Multisite?

    Thanks

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    Hi @sclosson,

    Thanks for your message.

    The configuration for Nginx should also work for Multisite mode. Try them out and let us know if you’ve made it.

    Thread Starter sclosson

    (@sclosson)

    Hey, thanks got it working, and just left it at via .htaccess in the Settings. Hope that isn’t a problem, converted all current images in the Media Library, haven’t uploaded any yet, but looking at the mime-types of the images, they are set to webp so I’m super excited and seems like the site is loading 5x faster now!

    Had to add some filters here, hopefully just the dir paths need to be changed and not the url paths:

    add_filter('webpc_uploads_root', function($path) {
      return '/www/';
    });
    
    add_filter('webpc_dir_path', function($path, $directory) {
                   if ($directory !== 'webp') {
        return '/www/wp-content/uploads';
      }
      return '/www/wp-content/uploads-webpc';
    }, 10, 2);
    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    I am happy to @sclosson!

    Use the following filters:

    add_filter( 'webpc_uploads_root', function( $path ) {
      return '/www/';
    } );
    
    add_filter( 'webpc_dir_path', function( $path, $directory ) {
      switch ($directory) {
        case 'uploads':
          return '/www/wp-content/uploads';
        case 'webp':
          return '/www/wp-content/uploads-webpc';
      }
      return $path;
    }, 10, 2 );

    Filter webpc_dir_path can use different $directory values: uploads, plugins, themes, or webp.

    Thread Starter sclosson

    (@sclosson)

    Wow, awesome. Thanks so much! You ROCK!

    In this case the path is symbolic or should I put the correct path that my wordpress is installed in?

    where I have to add the following filters

    add_filter( 'webpc_uploads_root', function( $path ) {
      return '/www/';
    } );
    
    add_filter( 'webpc_dir_path', function( $path, $directory ) {
      switch ($directory) {
        case 'uploads':
          return '/www/wp-content/uploads';
        case 'webp':
          return '/www/wp-content/uploads-webpc';
      }
      return $path;
    }, 10, 2 );
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Nginx Setup for Multisite?’ is closed to new replies.