以前の質問url-rewrite-rule-based-on-certain-conditions の続きで、 このように URL を書き換えようとしています。
http://www.mydomain.com/wp-content/plugins/pluginA/abc.css
http://www.mydomain.com/wp-content/plugins/pluginA/abc.js
CSS と JS がこのプラグイン (プラグイン A) または URL を書き換えたい他のプラグインからのものである場合、URL は次のように書き換えられる必要があります。
http://www.cdn.mydomain.com/wp-content/plugins/pluginA/abc.css
http://www.cdn.mydomain.com/wp-content/plugins/pluginA/abc.js
これは、.htaccessファイルで試したものです
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /wordpress/
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} ^.+\.(css|js)$
RewriteRule ^wp-content/plugins/(nivo-slider-light|Usernoise|lightbox-plus|wp-content-slideshow|content-slide)/(.+)$ http:/abc.cloudfront.net/wp-content/plugins/$1/$2 [L,R=302,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
JS と CSS が CDN サーバーから提供されるように URL を書き換えるためにあらゆる方法を試しましたが、ルールが apache によって取得されたことはないようです。