linux – 关闭htaccess会有明显的性能提升吗?

在apache中关闭htaccess的覆盖是否会提高性能?我在网上看了一下,关于此的文章/报道非常少.

如果是这种情况,我该怎么办呢?我会在认的虚拟主机文件中执行此操作吗?

一个例子是:
OpenCart附带2个主要用于mod_rewrite的htaccess文件,如果我将其移动到< Directory>这会有所作为吗?

<VirtualHost *:80>
    ServerAdmin www@shop.co.uk
    ServerName shop.co.uk
    ServerAlias www.shop.co.uk
    DocumentRoot /var/www/shop/public

    <Directory /var/www/shop/public>
        Options +FollowSymlinks

        # Prevent Direct Access to files
        <FilesMatch "\.(tpl|ini|log)">
         Order deny,allow
         Deny from all
        </FilesMatch>

        RewriteEngine On
        RewriteBase /
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^([^?]*) index.PHP?_route_=$1 [L,QSA]
    </Directory>

    <Directory /var/www/shop/public/admin/view/javascript/ckeditor>
        AddType application/x-javascript .js
        AddType text/css .css

        # If PHP is mapped to handle XML files,you Could have some issues. The following will disable it.
        AddType text/xml .xml
    </Directory>

    ErrorLog /var/log/apache2/shop-error.log
    LogLevel warn
    CustomLog /var/log/apache2/shop-access.log combined
</VirtualHost>

解决方法

Apache每次访问文件时都不需要查找.htaccess文件.实际的性能优势将取决于,

>您网站的流量
>网站布局
>服务器档案

我建议您使用Web压力工具(例如Apache的ab)进行基线现有性能,进行更改,重新配置,并查看它有多大的影响.

至于你的第二个问题,是的,我相信你会把.htaccess的东西转移到< Directory> < VirtualHost>中的部分.

相关文章

1、安装Apache。 1)执行如下命令,安装Apache服务及其扩展包...
一、先说一下用ansible批量采集机器信息的实现办法: 1、先把...
安装配置 1. 安装vsftpd 检查是否安装了vsftpd # rpm -qa | ...
如何抑制stable_secret读取关键的“net.ipv6.conf.all.stabl...
1 删除0字节文件 find -type f -size 0 -exec rm -rf {} ...
## 步骤 1:安装必要的软件包 首先,需要确保系统已安装 `dh...