我应该在我的 .htaccess 文件中删除或添加一些东西吗?

用户7704335

htaccess 文件.. 可以吗,或者我有任何错误?

其中一些代码是由 wordpress 插件生成的,我添加了一些从一些博客中找到的行。所以你怎么看?我应该删除还是添加一些东西?

        # BEGIN Far Future Expiration Plugin
        <IfModule mod_expires.c>
        ExpiresActive on
        <FilesMatch "\.(gif|jpeg|jpg|png|ico|js|css|swf)$">
        ExpiresDefault "access plus 168 hours"
        </FilesMatch>
        </IfModule>
        # END Far Future Expiration Plugin

        #Expires headers configuration added by Speed of Light plugin
        <IfModule mod_expires.c>
        ExpiresActive On
        ExpiresDefault A2592000
        ExpiresByType application/javascript "access plus 7 days"
        ExpiresByType text/javascript "access plus 7 days"
        ExpiresByType text/css "access plus 7 days"
        ExpiresByType image/jpeg "access plus 7 days"
        ExpiresByType image/png "access plus 7 days"
        ExpiresByType image/gif "access plus 7 days"
        ExpiresByType image/ico "access plus 7 days"
        ExpiresByType image/x-icon "access plus 7 days"
        ExpiresByType image/svg+xml "access plus 7 days"
        ExpiresByType image/bmp "access plus 7 days"
        ExpiresByType font/truetype "access plus 7 days"
        ExpiresByType font/opentype  "access plus 7 days"
        ExpiresByType application/x-font-woff "access plus 7 days"
        ExpiresByType application/vnd.ms-fontobject "access plus 7 days"
        </IfModule>
        #End of expires headers configuration

        # 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>

        # END WordPress

        <IfModule mod_deflate.c>
        # Compress HTML, CSS, JavaScript, Text, XML and fonts
        AddOutputFilterByType DEFLATE text/plain
        AddOutputFilterByType DEFLATE text/html
        AddOutputFilterByType DEFLATE text/xml
        AddOutputFilterByType DEFLATE text/css
        AddOutputFilterByType DEFLATE application/xml
        AddOutputFilterByType DEFLATE application/xhtml+xml
        AddOutputFilterByType DEFLATE application/rss+xml
        AddOutputFilterByType DEFLATE application/javascript
        AddOutputFilterByType DEFLATE application/x-javascript
        AddType x-font/otf .otf
        AddType x-font/ttf .ttf
        AddType x-font/eot .eot
        AddType x-font/woff .woff
        AddType image/x-icon .ico
        AddType image/png .png
        AddType text/css .css
        AddType image/jpg .jpg

        # Remove browser bugs (only needed for really old browsers)
        BrowserMatch ^Mozilla/4 gzip-only-text/html
        BrowserMatch ^Mozilla/4\.0[678] no-gzip
        BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
        Header append Vary User-Agent
        </IfModule>

        # 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>

        # END WordPress

        <IfModule mod_deflate.c>
        # Compress HTML, CSS, JavaScript, Text, XML and fonts
        AddOutputFilterByType DEFLATE text/plain
        AddOutputFilterByType DEFLATE text/html
        AddOutputFilterByType DEFLATE text/xml
        AddOutputFilterByType DEFLATE text/css
        AddOutputFilterByType DEFLATE application/xml
        AddOutputFilterByType DEFLATE application/xhtml+xml
        AddOutputFilterByType DEFLATE application/rss+xml
        AddOutputFilterByType DEFLATE application/javascript
        AddOutputFilterByType DEFLATE application/x-javascript
        AddType x-font/otf .otf
        AddType x-font/ttf .ttf
        AddType x-font/eot .eot
        AddType x-font/woff .woff
        AddType image/x-icon .ico
        AddType image/png .png
        AddType text/css .css
        AddType image/jpg .jpg

        # Remove browser bugs (only needed for really old browsers)
        BrowserMatch ^Mozilla/4 gzip-only-text/html
        BrowserMatch ^Mozilla/4\.0[678] no-gzip
        BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
        Header append Vary User-Agent
        </IfModule>

        <ifModule mod_gzip.c>
        mod_gzip_on Yes
        mod_gzip_dechunk Yes
        mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
        mod_gzip_item_include handler ^cgi-script$
        mod_gzip_item_include mime ^text/.*
        mod_gzip_item_include mime ^application/x-javascript.*
        mod_gzip_item_exclude mime ^image/.*
        mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
        </ifModule>

        # BEGIN WP Performance Score Booster Settings
        # END WP Performance Score Booster Settings

PS 我有最后一个 ifModule 用较低的 i 而不是大写的 I 有关系吗?

兴奋剂

你有 2 次相同的代码

    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
    AddType x-font/otf .otf
    AddType x-font/ttf .ttf
    AddType x-font/eot .eot
    AddType x-font/woff .woff
    AddType image/x-icon .ico
    AddType image/png .png
    AddType text/css .css
    AddType image/jpg .jpg

尝试备份您的文件 .htaccess 并删除其中之一。

如果不起作用,请删除另一个

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

我应该在onDestroyView中删除OnClickListener吗?

来自分类Dev

我应该在C ++中删除静态对象吗

来自分类Dev

我应该在onDestroyView中删除OnClickListener吗?

来自分类Dev

我应该在双方都添加信息吗

来自分类Dev

我应该在移动文件之前关闭它吗?

来自分类Dev

我应该在移动文件之前关闭它吗?

来自分类Dev

我应该在模型中抛出HttpStatus异常吗?

来自分类Dev

我应该在交易中包含SELECT吗?

来自分类Dev

我应该在表示层中抛出异常吗?

来自分类Dev

我应该在virtualenv中安装python 3吗?

来自分类Dev

我应该在C ++的类中存储引用吗?

来自分类Dev

我应该在Rust中返回等待吗?

来自分类Dev

我应该在virtualenv中安装python 3吗?

来自分类Dev

我应该在系统中杀死僵尸进程吗?

来自分类Dev

我应该在备份中包含/ dev吗?

来自分类Dev

我应该在Java中嵌套这些类吗?

来自分类Dev

我应该在哪种模型中添加ManyToManyField?

来自分类Dev

我应该在哪里将afterLoad添加到一些jquery代码

来自分类Dev

我应该在使用throw时使用throw吗?

来自分类Dev

我应该在界面上公开Stream <T>吗?

来自分类Dev

我应该在嵌套块中使用weakSelf吗?

来自分类Dev

我应该在调度块中使用“ weakSelf”吗?

来自分类Dev

我应该在GraphQL中使用列表(数组)吗?

来自分类Dev

我应该在提交之前停止容器吗?

来自分类Dev

我应该在for in结构中使用var吗?

来自分类Dev

我应该在main(){}中使用#include语句吗?

来自分类Dev

我应该在componentWillReceiveProps内调用动作吗?

来自分类Dev

我应该在乎模拟对象的调用次数吗

来自分类Dev

我应该在这里使用HttpResponseRedirect吗?

Related 相关文章

热门标签

归档