• doctorofcredit

    (@doctorofcredit)


    Hi,

    When I have autoptimize enabled it seems to be serving the css file from a http file rather than https, causing the site to break. Any way to fix it? Have disabled autoptimize for now.

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    AO uses site_url() to determine the “root” of URL to the autoptimized files. site_url is based on the settings in wp-admin/options-general.php, are those both set to https://?

    frank

    Thread Starter doctorofcredit

    (@doctorofcredit)

    Yes, both set to https

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    surprising .. do you have a staging-site where we could test this?

    Thread Starter doctorofcredit

    (@doctorofcredit)

    Not currently unfortunately

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    OK, as a root cause analysis is not possible, you could use this code snippet which will force the links to autoptimized files to https;

    add_filter( 'autoptimize_filter_js_bodyreplacementpayload', 'ao_forcehttps' );
    add_filter( 'autoptimize_filter_css_bodyreplacementpayload', 'ao_forcehttps' );
    
    function ao_forcehttps( $url ) {
    	return str_replace( 'https://', 'https://', $url );
    }
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘http file’ is closed to new replies.