Title: URL Replacement in CSS file is not relative, breaks https
Last modified: September 15, 2017

---

# URL Replacement in CSS file is not relative, breaks https

 *  [awhig](https://wordpress.org/support/users/awhig/)
 * (@awhig)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/url-replacement-in-css-file-is-not-relative-breaks-https/)
 * I’m using Cloudfront CDN, along with minifying my css files.
 * The bootstrap css file contains URL’s to font files. These URL’s are replaced
   with the CDN URL, but hardcodes the scheme (http). This causes issues when I 
   hit the site via https.
 * Another user suggested that you modify the ‘Theme file types to upload:’ field,
   and remove the font file types. This would then ignore the font file URL’s, leaving
   the relative URL’s in place, and allow it to work with http and https.
 * [https://wordpress.org/support/topic/minify-css-fonts-not-requested-over-ssl/#post-9494279](https://wordpress.org/support/topic/minify-css-fonts-not-requested-over-ssl/#post-9494279)
 * This does not seem to work for me using Cloudfront PULL, as these files are never
   uploaded by W3TC, Cloudfront, pulls them, and I assume W3TC is ignoring this 
   field, when replacing URLs.
 * I tried using the Reject files options, but could not get that to work. My minified
   and combined css files, still have the CDN URL as http:// scheme. I would like
   it to not touch this URL, so that the scheme would be relative. Because the boostrap.
   min.css file is loaded from the CDN, then the fonts files would also be loaded
   from there as well.
 * Specificially this is happening in bootstrap.min.css which has
 * @font-face{font-family:’Glyphicons Halflings’;src:url(../fonts/glyphicons-halflings-
   regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format(’
   embedded-opentype’),url(../fonts/glyphicons-halflings-regular.woff2) format(‘
   woff2′), etc
 * gets replaced with
 * @font-face{font-family:’Glyphicons Halflings’;src:url([http://cdn5XXXX/sgmwp/wp-content/themes/se-2016/js/bootstrap/fonts/glyphicons-halflings-regular.eot](http://cdn5XXXX/sgmwp/wp-content/themes/se-2016/js/bootstrap/fonts/glyphicons-halflings-regular.eot));
   src:url([http://cdn5XXXX/sgmwp/wp-content/themes/se-2016/js/bootstrap/fonts/glyphicons-halflings-regular.eot?#iefix](http://cdn5XXXX/sgmwp/wp-content/themes/se-2016/js/bootstrap/fonts/glyphicons-halflings-regular.eot?#iefix))
   format(’embedded-opentype’),url([http://cdn5XXXX/sgmwp/wp-content/themes/se-2016/js/bootstrap/fonts/glyphicons-halflings-regular.woff2](http://cdn5XXXX/sgmwp/wp-content/themes/se-2016/js/bootstrap/fonts/glyphicons-halflings-regular.woff2))
   format(‘woff2’),url([http://cdn5XXXX/sgmwp/wp-content/themes/se-2016/js/bootstrap/fonts/glyphicons-halflings-regular.woff](http://cdn5XXXX/sgmwp/wp-content/themes/se-2016/js/bootstrap/fonts/glyphicons-halflings-regular.woff))
   format(‘woff’),url([http://cdn5XXXX/sgmwp/wp-content/themes/se-2016/js/bootstrap/fonts/glyphicons-halflings-regular.ttf](http://cdn5XXXX/sgmwp/wp-content/themes/se-2016/js/bootstrap/fonts/glyphicons-halflings-regular.ttf))
   format(‘truetype’),url([http://cdn5XXXX/sgmwp/wp-content/themes/se-2016/js/bootstrap/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular](http://cdn5XXXX/sgmwp/wp-content/themes/se-2016/js/bootstrap/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular))
   format(‘svg’)}.glyphicon{position:relative;top:1px;display:inline-block;font-
   family:’Glyphicons Halflings’;
 * Does anyone know how to do this?
 * Thanks,
    Rich

The topic ‘URL Replacement in CSS file is not relative, breaks https’ 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/)

 * 0 replies
 * 1 participant
 * Last reply from: [awhig](https://wordpress.org/support/users/awhig/)
 * Last activity: [8 years, 9 months ago](https://wordpress.org/support/topic/url-replacement-in-css-file-is-not-relative-breaks-https/)
 * Status: not resolved