The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

[Plugin: Autoptimize] https issue (3 posts)

  1. Jen Baumann
    Posted 7 years ago #

    This plugin works well for my html and css. It does break the Featured Content Gallery if js is turned on.

    My question though is, if part of a blog is http:// and part of it is https://, what code needs to be edited so that the style sheet isn't http:// on the https:// pages?


  2. turl
    Posted 7 years ago #


    If WordPress is configured to use HTTPS, the plugin will make CSS and HTML urls using HTTPS. But if only some part is in HTTPS, you will need to hack "autoptimize.php" around line 19, where it says


    You might want to replace it with something like this:

    if($_SERVER['https'] == 1 || $_SERVER['https'] == 'on' || $_SERVER['SERVER_PORT'] == 443) {

    It's based on this code -> http://wordpress.org/support/topic/264510?replies=1

    Also, to do that modification you'll need Autoptimize 0.9 that I'll release later on today, or tomorrow. Check the version here: http://wordpress.org/extend/plugins/autoptimize/


  3. Jen Baumann
    Posted 7 years ago #

    Thanks for getting back to me and sorry for the late reply. I will give this a shot when I get back from vacation and let you know how it works.

Topic Closed

This topic has been closed to new replies.

About this Topic