因此,由於我在我的網站上託管我的博客在同一臺服務器上,我想我會創建一個別名,以便我可以拉入我的投資組合。.htaccess沒有緩存別名文件夾的圖像
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/
?