apache_conf .htaccess文件适用于Vanish缓存

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了apache_conf .htaccess文件适用于Vanish缓存相关的知识,希望对你有一定的参考价值。

#Unset all Cookies!
Header unset Cookie
Header unset Set-Cookie

<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On 
# Default directive
ExpiresDefault "access plus 1 month"
# My favicon
ExpiresByType image/x-icon "access plus 1 year"
# Media: images, video, audio
  ExpiresByType image/gif                 "access plus 1 month"
  ExpiresByType image/png                 "access plus 1 month"
  ExpiresByType image/jpg                 "access plus 1 month"
  ExpiresByType image/jpeg                "access plus 1 month"
  ExpiresByType video/ogg                 "access plus 1 month"
  ExpiresByType audio/ogg                 "access plus 1 month"
  ExpiresByType video/mp4                 "access plus 1 month"
  ExpiresByType video/webm                "access plus 1 month"
# Webfonts
  ExpiresByType font/truetype             "access plus 1 month"
  ExpiresByType font/opentype             "access plus 1 month"
  ExpiresByType application/x-font-woff   "access plus 1 month"
  ExpiresByType image/svg+xml             "access plus 1 month"
  ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
# CSS and JavaScript
  ExpiresByType text/css                  "access plus 1 year"
  ExpiresByType application/javascript    "access plus 1 year"
  ExpiresByType text/javascript           "access plus 1 year"
</IfModule>
<IfModule mod_headers.c>
    Header append Cache-Control "public"
</IfModule>

# -----------------------Force https----------------------------------------------------------
RewriteEngine On
# This will enable the Rewrite capabilities
 
RewriteOptions InheritDownBefore
# This prevents the rule from being overrided by .htaccess files in subdirectories.
 
RewriteCond %{HTTPS} !=on
# This checks to make sure the connection is not already HTTPS
 
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [QSA,R,L]
# This rule will redirect users from their original location, to the same location but using HTTPS.
# i.e.  http://www.example.com/foo/ to https://www.example.com/foo/
# ----------------------\Force https----------------------------------------------------------

RewriteBase /
RewriteRule ^size/([0-9]+)/token/(.*)/image/(.*)$ make-thumbnail.php?size=$1&token=$2&image=$3 [NC]

以上是关于apache_conf .htaccess文件适用于Vanish缓存的主要内容,如果未能解决你的问题,请参考以下文章

apache_conf 上传最大文件大小 - .htaccess文件

apache_conf WordPress .HTACCESS启动文件

apache_conf WordPress .HTACCESS启动文件

apache_conf 使用.htaccess强制下载文件

apache_conf 默认WordPress .htaccess文件。

apache_conf Symfony完整的.htaccess文件