Your English are bad and I can't understand all of what you say. I guess you need a special component for this task that will load all the data remotely from CDN and you dont have to hack the elxisDocument library. Even without that component why you needed to modify elxis document? I dont understand that...If you want to load single articles you could create a content plugin.
$this->setHeader('Pragma', 'no-cache'); // HTTP 1.0if ($compress && !ini_get('zlib.output_compression') && ini_get('output_handler')!='ob_gzhandler') { $html = $this->compress($html);}
$this->setHeader('Pragma', 'no-cache'); // HTTP 1.0require_once 'CDN.class.php';$cdn = new CDN() ;$html = $cdn->parse( $html ) ;if ($compress && !ini_get('zlib.output_compression') && ini_get('output_handler')!='ob_gzhandler') { $html = $this->compress($html);}
foreach ($this->stylesheets as $href => $arr) { $links[] = $href; }
foreach ($this->stylesheets as $href => $arr) { if (strpos($href, 'http://www.mysite.com') === 0) { $newhref = str_replace('http://www.mysite.com', 'http://www.cdn.com/userX/myccss', $href); unset($this->stylesheets[$href]); $this->stylesheets[$newhref] = $arr; }}
I don't know what your CDN class does but there is a very simple way to do that. I guess all you need is to re-write your local links to CDN.Library: elxisDocument (includes/libraries/elxis/document.class.php)Find method fetchHeadOn line 416 you will find this:Code: [Select]foreach ($this->stylesheets as $href => $arr) { $links[] = $href; }Add ABOVE it the following:Code: [Select]foreach ($this->stylesheets as $href => $arr) { if (strpos($href, 'http://www.mysite.com') === 0) { $newhref = str_replace('http://www.mysite.com', 'http://www.cdn.com/userX/myccss', $href); unset($this->stylesheets[$href]); $this->stylesheets[$newhref] = $arr; }}The above will re-write ALL of your local CSS links (on domain example.com) to the ones on your CDN account (on domain cdn.com).Do the same if you want for the js files. Dont change anything else on Elxis, it will work like a charm.
RewriteEngine onRewriteRule ^media/(.*) http://www.cdn.com/userA/mediafiles/$1