更新时间:2023-11-27 08:02:04
这应该有效:
RewriteCond %{HTTP_HOST} ^yourdomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.yourdomain.com$
RewriteRule ^images/?(.*)$ "http://cdn.yourdomain.com/$1" [R=301,L]
但是,请注意,这只是一个临时解决方案!
为了最大限度地利用 CDN,您需要手动将图像指向 CDN,以便为每个图像保存一个 HTTP.
However, please note that this is just a temporary solution!
In order to get the max out of your CDN, you need manually point images to your CDN in order to save one HTTP for every image.