Title: Minify Adding HTTPS to URLs in CSS
Last modified: August 20, 2016

---

# Minify Adding HTTPS to URLs in CSS

 *  [digitalsky](https://wordpress.org/support/users/digitalsky/)
 * (@digitalsky)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/minify-adding-https-to-urls-in-css/)
 * I’m running the latest version of W3 Total Cache on my site at [http://www.pr-tech.com](http://www.pr-tech.com).
 * It works great with MaxCDN and my other settings but I’ve noticed a VERY odd 
   bug with the minify feature.
 * In my CSS file I have some urls specified for my background images like so…
 * background-image:url(images/background-sprite.jpg)
 * When I turn on minify EVERYTHING on my site works perfectly and it doesn’t cause
   anything to break, except when I check the minified CSS file I notice the code
   in my CSS has been changed to this…
 * background-image:url([https://cdn4.pr-tech.com/wp-content/themes/PR-Tech/images/background-sprite.jpg](https://cdn4.pr-tech.com/wp-content/themes/PR-Tech/images/background-sprite.jpg))
 * It’s putting an HTTPS (instead of HTTP) in front of the link which is causing
   the background images not to work. I can’t figure out for the life of me why 
   it won’t work properly. If you try that link without the HTTPS it works just 
   fine, but obviously with the HTTPS it doesn’t work.
 * Any ideas? Is this a bug or am I doing something wrong? When I turn off minify
   and empty the page cache everything is back to normal.
 * [http://wordpress.org/extend/plugins/w3-total-cache/](http://wordpress.org/extend/plugins/w3-total-cache/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [digitalsky](https://wordpress.org/support/users/digitalsky/)
 * (@digitalsky)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/minify-adding-https-to-urls-in-css/#post-3566244)
 * On another note, I’ve now added links like this in the CSS file…
 * `background-image:url(/wp-content/themes/PR-Tech/images/background-sprite.jpg)`
 * However, sure enough minify still seems to be adding an HTTPS to the beginning
   of every link. This makes no sense at all because I have SSL disabled completely
   on my CDN settings.
 *  [Bid13 Storage Auctions](https://wordpress.org/support/users/deweydb/)
 * (@deweydb)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/minify-adding-https-to-urls-in-css/#post-3566277)
 * I had the same problem, this was my fix:
    in w3-total-cache/lib/W3/Plugin/Minify.
   php
 * after:
 *     ```
       /**
                * Skip if user is logged in
                */
               if ($this->_config->get_boolean('minify.reject.logged') && !$this->check_logged_in()) {
                   $this->minify_reject_reason = 'User is logged in';
   
                   return false;
               }
       ```
   
 * add:
 *     ```
       /**
                * Do not minify if SSL
                */
               if (w3_is_https() ) {
                   $this->minify_reject_reason = 'SSL is rejected';
   
                   return false;
               }
       ```
   
 *  [Bid13 Storage Auctions](https://wordpress.org/support/users/deweydb/)
 * (@deweydb)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/minify-adding-https-to-urls-in-css/#post-3566278)
 * There is probably a better fix, where you don’t do the url rewriting if the $
   this->_config->get_boolean(‘cdn.reject.ssl’) option is enabled, but i couldn’t
   figure it out.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Minify Adding HTTPS to URLs in CSS’ is closed to new replies.

 * ![](https://ps.w.org/w3-total-cache/assets/icon-256x256.png?rev=1041806)
 * [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/w3-total-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/w3-total-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/w3-total-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/w3-total-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/w3-total-cache/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Bid13 Storage Auctions](https://wordpress.org/support/users/deweydb/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/minify-adding-https-to-urls-in-css/#post-3566278)
 * Status: not resolved