• HI,

    I’m using wordpress 3.5.2 and W3 Total Cache 0.9.2.11.

    I’m trying to set up a cdn with Amazon S3.

    My theme is using a dynamically generated css by including a file named “style.css.php”
    <link class="nocdn" rel="stylesheet" href="http://www.domain.com/wp-content/themes/lespaul/assets/css/style.css.php?ver=20130601" type="text/css" media="screen">

    What I need is to tell W3 Total Cache is don’t request that stylesheet to the cdn because it is needed to be served from the content server

    For example, W3 Total Cache is going to change the previous link to:
    <link class="nocdn" rel="stylesheet" href="http://static.cname.net/wp-content/themes/lespaul/assets/css/style.css.php?ver=20130601" type="text/css" media="screen">

    I need to keep it as before, pointing to the domain http://www.domain.com

    In my web site i’m requesting other stylesheets that need to be requested from the cdn.

    Thanks in advance.

    http://ww.wp.xz.cn/extend/plugins/w3-total-cache/

Viewing 2 replies - 1 through 2 (of 2 total)
  • I would like to know the answer to this as well. I have a CSS including font files but fonts require a CORS header to work properly across domains in some browser (like Firefox and IE). This is an issue because a number of firewalls block various headers (including CORS) from coming though. I need a way to get the default URL path without the converting to the CDN domain. Any way to do this?

    plugins_url() and get_template_directory_uri() both convert to the CDN domain. Is there another function that will do the same without passing back the CDN domain?

    Eureka! I figured it out!

    Go to the W3TC CDN settings page and under the “Advanced” header there is a “Rejected files” entry with a textarea. Enter the path to your file and it removes the CDN domain.

    jesusim, in your case you would enter something like:
    {wp_content_dir}/themes/lespaul/assets/css/style.css.php

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

The topic ‘Exclude stylesheet from being requested from cdn’ is closed to new replies.