W3 Total Cache
[resolved] HTTPS / HTTP Minify Protocol Specific URL (4 posts)

  1. michael_fcc
    Posted 3 years ago #

    I have setup WordPress to use protocol relative paths for css and js:

    ex: /wp-content/themes/responsive/style.css

    instead of: http://www.mydomain.com/wp-content/themes/responsive/style.css

    It works when minify is disabled, however when I enable it, the full path is still present


    I need the minify to use protocol relative url like all other elements in my wordpress because I have some pages that are HTTPS or switch to HTTPS with ajax and the css and js will not load because the minify forces the absolute url.

    I would appreciate any help!

    Thank you!


  2. michael_fcc
    Posted 3 years ago #

    Ok so I found a solution:

    in /wp-content/plugins/w3-total-cache/inc/define.php edit around line 467

    return $url;


    return "";

    This will ensure all css + js resources load as a protocol relative path (without the domain) so you can use mixed modes of http and https

  3. Frederick Townes
    Plugin Author

    Posted 2 years ago #

    The minify urls are changed on detection of SSL. Will look at adding protocall relative URLs to minify.

  4. michael_fcc
    Posted 2 years ago #

    Thank you Fredrick!

    I look forward to this feature being implemented!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • W3 Total Cache
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic