Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache .htaccess在Linux环境中引发内部服务器错误_Apache_.htaccess - Fatal编程技术网

Apache .htaccess在Linux环境中引发内部服务器错误

Apache .htaccess在Linux环境中引发内部服务器错误,apache,.htaccess,Apache,.htaccess,几年前,在Firefox扩展的引导下,友好URL的繁荣,我认为是来自雅虎!开发人员,在分析页面后提供一些优化提示,给它打分抱歉,我不记得我构建的这个.htaccess文件的名称: 以及apachectl-M的输出: 两台机器上运行的Apache版本是否相同?请查看/var/log/apache2/error.log,例如tail/var/log/apache2/error.log,并在此处发布输出,然后我们可能会提供帮助。还要检查编译和加载的模块-l和-M,分别查看apachectl是否存在您正

几年前,在Firefox扩展的引导下,友好URL的繁荣,我认为是来自雅虎!开发人员,在分析页面后提供一些优化提示,给它打分抱歉,我不记得我构建的这个.htaccess文件的名称:

以及apachectl-M的输出:


两台机器上运行的Apache版本是否相同?请查看/var/log/apache2/error.log,例如tail/var/log/apache2/error.log,并在此处发布输出,然后我们可能会提供帮助。还要检查编译和加载的模块-l和-M,分别查看apachectl是否存在您正在使用的所有模块。hjpotter92:我不确定它们是否完全相同。我的意思是,在Windows中,我通常会从ApacheLounge 2.x.x安装最新的VC9。在这个Linux环境中安装时,我只使用apache2作为apt get的参数@CodeGruzzler:现在我可以阅读它了,它在抱怨头命令不匹配或错误。我对所有3次出现的错误都进行了注释,并且都成功了。每500个错误都会记录在Apache的error.log中。看看它说了些什么。
# Far-away Cache Expiration
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Expires "Thu, 15 Apr 2050 20:00:00 GMT"
</FilesMatch>

# Output Compression

<IfModule mod_deflate.c>

    <FilesMatch "\.(css|js|html|php)$">
        SetOutputFilter DEFLATE
    </FilesMatch>

</IfModule>

<IfModule mod_setenvif.c>
    # Netscape 4.x has some problems...
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    # Netscape 4.06-4.08 have some more problems
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    # MSIE masquerades as Netscape, but it is fine
    BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
    # Don't compress images or already compressed files
    SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
    SetEnvIfNoCase Request_URI .(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
    SetEnvIfNoCase Request_URI .(?:avi|mov|mp3|mp4|rm|flv|swf|mp?g)$ no-gzip dont-vary
    SetEnvIfNoCase Request_URI .pdf$ no-gzip dont-vary
</IfModule>

# Headers Fix

<IfModule mod_headers.c>
    # Make sure proxies don't deliver the wrong content
    Header append Vary User-Agent env=!dont-vary
</IfModule>

# ETag, whatever is that

Header unset ETag

FileETag None

# Rewrite Rules

RewriteEngine On

RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php [L]
Compiled in modules:
  core.c
  mod_so.c
  mod_watchdog.c
  http_core.c
  mod_log_config.c
  mod_logio.c
  mod_version.c
  mod_unixd.c
Loaded Modules:
 core_module (static)
 so_module (static)
 watchdog_module (static)
 http_module (static)
 log_config_module (static)
 logio_module (static)
 version_module (static)
 unixd_module (static)
 access_compat_module (shared)
 alias_module (shared)
 auth_basic_module (shared)
 authn_core_module (shared)
 authn_file_module (shared)
 authz_core_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 deflate_module (shared)
 dir_module (shared)
 env_module (shared)
 filter_module (shared)
 mime_module (shared)
 mpm_prefork_module (shared)
 negotiation_module (shared)
 php5_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 status_module (shared)