そのため、私は自分のサイトと同じサーバーでブログをホストしているので、ポートフォリオを取り込めるようにエイリアスを作成することにしました。
Alias /port-images/ /the/real/location/wp-content/uploads/
私のブログと画像を取得しているサイトの両方に、次の .htaccess コードが含まれています。
# caching static files
<IfModule mod_headers.c>
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|bmp|js|css|swf|woff|svg|ttf|otf|eot)(\.gz)?$">
Header unset Pragma
Header unset ETag
Header set Cache-Control "max-age=31556000, store, cache"
Header unset Last-Modified
Header set Connection keep-alive
Header add X-PoweredBy ""
</FilesMatch>
</IfModule>
FileETag None
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 seconds"
ExpiresByType text/html M31556000
ExpiresByType image/gif M31556000
ExpiresByType image/jpeg M31556000
ExpiresByType image/png M31556000
ExpiresByType text/css M31556000
ExpiresByType text/javascript M31556000
ExpiresByType application/javascript M31556000
ExpiresByType application/x-javascript M31556000
ExpiresByType text/xml M31556000
ExpiresByType image/svg+xml M31556000
ExpiresByType application/x-font-ttf M31556000
ExpiresByType application/x-font-truetype M31556000
ExpiresByType application/x-font-opentype M31556000
ExpiresByType application/vnd.ms-fontobject M31556000
ExpiresByType application/x-font-woff M31556000
</IfModule>
# For servers that support output compression, you should pick up a bit of
# speed by un-commenting the following lines.
php_flag zlib.output_compression On
php_value zlib.output_compression_level 9
画像は問題なく取り込まれますが、取り込まれる画像にはこのキャッシュが適用されません。これと同じ .htaccess をに追加しても/the/real/location/wp-content/uploads/
、違いはありません。
これらの .htaccess 設定が、次の場所にあるすべてのファイル/サブフォルダーに対して有効であることを確認するにはどうすればよい/the/real/location/wp-content/uploads/
ですか?