• Resolved Jake Bohall

    (@jblifestyles)


    It appears this plugin also impacts the backend urls, and is messing with our ability to access the admin panel of wordpress.

    What is the best way to make it so there is an exception for anything requested within the wp-admin directory?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    @jblifestyles Currently, there is one filter that you can use to use full paths.
    add_filter( 'paths_relative', 'yasglobal_change_path' );

    You can find the example here:
    https://github.com/yasglobal/make-paths-relative#filters

    Please make sure to make adjustments as per your need. I will introduce another filter or setting to avoid it on the Admin pages.

    Thanks & Regards,
    Sami

    Thread Starter Jake Bohall

    (@jblifestyles)

    In this case, you are suggesting this?

    function yasglobal_change_path( $link ) {
      if(strpos($link,'/wp-admin') !== false || strpos($link,'/wp-includes' !== false) {
        $link = site_url().$link';
      }
      return $link;
    }
    
    add_filter( 'paths_relative', 'yasglobal_change_path' );
    
    • This reply was modified 3 years, 1 month ago by Jake Bohall.
    Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    @jblifestyles Yes, Have you tried it?

    Thread Starter Jake Bohall

    (@jblifestyles)

    Not yet.. I’m trying to pair this solution with another issue I have…

    We are actually running the site behind a reverse proxy and the admin section is accessed on a different hostname than the production site (intentional for security, etc.)

    When we use relative paths, this works great for caching, etc.. but then it also breaks some functionality (e.g. when we try to use visual editors, it tries to interact with cache vs. origin). We are also seeing the backend issue pop up (multi-site) for the child sites that are set at a subdirectory.

    I’m trying to think of a better solution and am going to test relative path is “disabled” completely for logged in users, as I think that may work better to solve the larger problems

    E.g.

    function yasglobal_change_path( $link ) {
       if ( is_user_logged_in() ) {
           $link = site_url().$link';
       }
       return $link;
    }
    
    add_filter( 'paths_relative', 'yasglobal_change_path' );
    Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    @jblifestyles Sounds good

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Conflict with Admin on Reverse Proxy’ is closed to new replies.