質問: あなたの.htaccessファイルのためのコードの最高のコレクション functions.phpファイルには ベストコレクションのコード threadがありますので、.htaccessファイルにスレッドを作成すると便利かもしれないと思いました。 このリストに自分のスニペットを追加する場合は、必ず覚えてください
回答: これはもっと安全なものです。# begin wordpress browser cache <ifmodule mod_mime.c> addtype text/css .css addtype application/x-javascript .js addtype text/x-component .htc addtype text/html .html .htm addtype text/richtext .rtf .rtx addtype image/svg+xml .svg .svgz addtype text/plain .txt addtype text/xsd .xsd addtype text/xsl .xsl addtype text/xml .xml addtype video/asf .asf .asx .wax .wmv .wmx addtype video/avi .avi addtype image/bmp .bmp addtype application/java .class addtype video/divx .divx addtype application/msword .doc .docx addtype application/vnd.ms-fontobject .eot addtype application/x-msdownload .exe addtype image/gif .gif addtype application/x-gzip .gz .gzip addtype image/x-icon .ico addtype image/jpeg .jpg .jpeg .jpe addtype application/vnd.ms-access .mdb addtype audio/midi .mid .midi addtype video/quicktime .mov .qt addtype audio/mpeg .mp3 .m4a addtype video/mp4 .mp4 .m4v addtype video/mpeg .mpeg .mpg .mpe addtype application/vnd.ms-project .mpp addtype application/x-font-otf .otf addtype application/vnd.oasis.opendocument.database .odb addtype application/vnd.oasis.opendocument.chart .odc addtype application/vnd.oasis.opendocument.formula .odf addtype application/vnd.oasis.opendocument.graphics .odg addtype application/vnd.oasis.opendocument.presentation .odp addtype application/vnd.oasis.opendocument.spreadsheet .ods addtype application/vnd.oasis.opendocument.text .odt addtype audio/ogg .ogg addtype application/pdf .pdf addtype image/png .png addtype application/vnd.ms-powerpoint .pot .pps .ppt .pptx addtype audio/x-realaudio .ra .ram addtype application/x-shockwave-flash .swf addtype application/x-tar .tar addtype image/tiff .tif .tiff addtype application/x-font-ttf .ttf .ttc addtype audio/wav .wav addtype audio/wma .wma addtype application/vnd.ms-write .wri addtype application/vnd.ms-excel .xla .xls .xlsx .xlt .xlw addtype application/zip .zip </ifmodule> <ifmodule mod_expires.c> expiresactive on expiresbytype text/css a31536000 expiresbytype application/x-javascript a31536000 expiresbytype text/x-component a31536000 expiresbytype text/html a3600 expiresbytype text/richtext a3600 expiresbytype image/svg+xml a3600 expiresbytype text/plain a3600 expiresbytype text/xsd a3600 expiresbytype text/xsl a3600 expiresbytype text/xml a3600 expiresbytype video/asf a31536000 expiresbytype video/avi a31536000 expiresbytype image/bmp a31536000 expiresbytype application/java a31536000 expiresbytype video/divx a31536000 expiresbytype application/msword a31536000 expiresbytype application/vnd.ms-fontobject a31536000 expiresbytype application/x-msdownload a31536000 expiresbytype image/gif a31536000 expiresbytype application/x-gzip a31536000 expiresbytype image/x-icon a31536000 expiresbytype image/jpeg a31536000 expiresbytype application/vnd.ms-access a31536000 expiresbytype audio/midi a31536000 expiresbytype video/quicktime a31536000 expiresbytype audio/mpeg a31536000 expiresbytype video/mp4 a31536000 expiresbytype video/mpeg a31536000 expiresbytype application/vnd.ms-project a31536000 expiresbytype application/x-font-otf a31536000 expiresbytype application/vnd.oasis.opendocument.database a31536000 expiresbytype application/vnd.oasis.opendocument.chart a31536000 expiresbytype application/vnd.oasis.opendocument.formula a31536000 expiresbytype application/vnd.oasis.opendocument.graphics a31536000 expiresbytype application/vnd.oasis.opendocument.presentation a31536000 expiresbytype application/vnd.oasis.opendocument.spreadsheet a31536000 expiresbytype application/vnd.oasis.opendocument.text a31536000 expiresbytype audio/ogg a31536000 expiresbytype application/pdf a31536000 expiresbytype image/png a31536000 expiresbytype application/vnd.ms-powerpoint a31536000 expiresbytype audio/x-realaudio a31536000 expiresbytype image/svg+xml a31536000 expiresbytype application/x-shockwave-flash a31536000 expiresbytype application/x-tar a31536000 expiresbytype image/tiff a31536000 expiresbytype application/x-font-ttf a31536000 expiresbytype audio/wav a31536000 expiresbytype audio/wma a31536000 expiresbytype application/vnd.ms-write a31536000 expiresbytype application/vnd.ms-excel a31536000 expiresbytype application/zip a31536000 </ifmodule> <ifmodule mod_deflate.c> <ifmodule mod_setenvif.c> browsermatch ^mozilla/4 gzip-only-text/html browsermatch ^mozilla/4\.0[678] no-gzip browsermatch \bmsie !no-gzip !gzip-only-text/html browsermatch \bmsi[e] !no-gzip !gzip-only-text/html </ifmodule> <ifmodule mod_headers.c> header append vary user-agent env=!dont-vary </ifmodule> <ifmodule mod_filter.c> addoutputfilterbytype deflate text/css application/x-javascript text/x-component text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon </ifmodule> </ifmodule> <filesmatch "\.(css|js|htc|css|js|htc)$"> <ifmodule mod_headers.c> header set pragma "public" header append cache-control "public, must-revalidate, proxy-revalidate" </ifmodule> fileetag mtime size <ifmodule mod_headers.c> header set x-powered-by "w3 total cache/0.9.2.4" </ifmodule> </filesmatch> <filesmatch "\.(html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml|html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml)$"> <ifmodule mod_headers.c> header set pragma "public" header append cache-control "public, must-revalidate, proxy-revalidate" </ifmodule> fileetag mtime size <ifmodule mod_headers.c> header set x-powered-by "w3 total cache/0.9.2.4" </ifmodule> </filesmatch> <filesmatch "\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip|asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip)$"> <ifmodule mod_headers.c> header set pragma "public" header append cache-control "public, must-revalidate, proxy-revalidate" </ifmodule> fileetag mtime size <ifmodule mod_headers.c> header set x-powered-by "w3 total cache/0.9.2.4" </ifmodule> </filesmatch> # end wordpress browser cache # begin wordpress page cache core <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^(.*\/)?wordpress_rewrite_test$ $1?wordpress_rewrite_test=1 [l] rewritecond %{http:accept-encoding} gzip rewriterule .* - [e=wordpress_enc:_gzip] rewritecond %{request_method} !=post rewritecond %{query_string} ="" rewritecond %{http_host} =hubtank.com rewritecond %{request_uri} !(\/wp-admin\/|\/xmlrpc.php|\/wp-(app|cron|login|register|mail)\.php|\/feed\/|wp-.*\.php|index\.php) [nc,or] rewritecond %{request_uri} (wp-comments-popup\.php|wp-links-opml\.php|wp-locations\.php) [nc] rewritecond %{http_cookie} !(comment_author|wp-postpass|wordpress_\[a-f0-9\]\+|wordpress_logged_in) [nc] rewritecond %{http_user_agent} !(w3\ total\ cache/0\.9\.2\.4) [nc] rewritecond "%{document_root}/wp-content/wordpress/pgcache/%{request_uri}/_index%{env:wordpress_ua}%{env:wordpress_ref}%{env:wordpress_ssl}.html%{env:wordpress_enc}" -f rewriterule .* "/wp-content/wordpress/pgcache/%{request_uri}/_index%{env:wordpress_ua}%{env:wordpress_ref}%{env:wordpress_ssl}.html%{env:wordpress_enc}" [l] </ifmodule> # end wordpress page cache core # begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule>