Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.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_Apache_.htaccess_Drupal 7 - Fatal编程技术网

apache未加载htaccess

apache未加载htaccess,apache,.htaccess,drupal-7,Apache,.htaccess,Drupal 7,我试图让Apache识别Drupal网站根目录下的htaccess文件,但无论我尝试什么设置,它都会被忽略。mod_重写模块已加载,AllowOverride设置为All,且所有路径均正确。htaccess文件有我能找到的最基本的设置,但这并不重要,因为如果我用垃圾文本填充它,它仍然无法工作。我在网上搜寻,试图找到答案,但什么都没用。你的任何想法都会很有帮助。我使用Apache2.2.15和Drupal7运行CentOS6.3 以下是.htaccess文件: </IfModule>

我试图让Apache识别Drupal网站根目录下的htaccess文件,但无论我尝试什么设置,它都会被忽略。mod_重写模块已加载,AllowOverride设置为All,且所有路径均正确。htaccess文件有我能找到的最基本的设置,但这并不重要,因为如果我用垃圾文本填充它,它仍然无法工作。我在网上搜寻,试图找到答案,但什么都没用。你的任何想法都会很有帮助。我使用Apache2.2.15和Drupal7运行CentOS6.3

以下是.htaccess文件:

</IfModule>

# Various rewrite rules.
<IfModule mod_rewrite.c>
  RewriteEngine on

# If you do not have mod_rewrite installed, you should remove these
# directories from your webroot or otherwise protect them from being
# downloaded.
  RewriteRule "(^|/)\." - [F] 

# Pass all requests not referring directly to files in the filesystem to
# index.php. Clean URLs are handled in drupal_environment_initialize().
  RewriteCond %{REQUEST_FILENAME} !-f 
  RewriteCond %{REQUEST_FILENAME} !-d 
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^ index.php [L] 

# Rules to correctly serve gzip compressed CSS and JS files.
# Requires both mod_rewrite and mod_headers to be enabled.
  <IfModule mod_headers.c>
# Serve gzip compressed CSS files if they exist and the client accepts gzip.
    RewriteCond %{HTTP:Accept-encoding} gzip
    RewriteCond %{REQUEST_FILENAME}\.gz -s
    RewriteRule ^(.*)\.css $1\.css\.gz [QSA]

# Serve gzip compressed JS files if they exist and the client accepts gzip.
    RewriteCond %{HTTP:Accept-encoding} gzip
    RewriteCond %{REQUEST_FILENAME}\.gz -s
    RewriteRule ^(.*)\.js $1\.js\.gz [QSA]

# Serve correct content types, and prevent mod_deflate double gzip.
    RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1]
    RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1]

    <FilesMatch "(\.js\.gz|\.css\.gz)$">
 # Serve correct encoding type.
      Header set Content-Encoding gzip
 # Force proxies to cache gzipped & non-gzipped css/js files separately.
      Header append Vary Accept-Encoding
    </FilesMatch>
  </IfModule>
</IfModule>

#各种重写规则。
重新启动发动机
#如果未安装mod_rewrite,则应删除这些
#从您的webroot目录或以其他方式保护它们不被删除
#下载。
重写规则“(^ |/)\”-[F]
#将所有不直接引用文件系统中文件的请求传递给
#index.php。干净的URL在drupal_环境_initialize()中处理。
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_URI}=/图标文件
重写规则^index.php[L]
#正确提供gzip压缩CSS和JS文件的规则。
#需要同时启用mod_重写和mod_头。
#如果存在gzip压缩的CSS文件并且客户端接受gzip,则为其提供服务。
RewriteCond%{HTTP:Accept encoding}gzip
重写cond%{REQUEST_FILENAME}\.gz-s
重写规则^(.*)\.css$1\.css\.gz[QSA]
#如果存在gzip压缩的JS文件并且客户端接受gzip,则为其提供服务。
RewriteCond%{HTTP:Accept encoding}gzip
重写cond%{REQUEST_FILENAME}\.gz-s
重写规则^(.*)\.js$1\.js\.gz[QSA]
#提供正确的内容类型,并防止mod_deflate double gzip。
重写规则\.css\.gz$-[T=text/css,E=no gzip:1]
重写规则\.js\.gz$-[T=text/javascript,E=no gzip:1]
#提供正确的编码类型。
标题集内容编码gzip
#强制代理分别缓存gzip和非gzip css/js文件。
头附加变量接受编码
谢谢,
-Dave

你介意发布你的实际
.htaccess
文件吗?是的,刚刚添加了它,对不起@皮埃尔·奥利维耶·布尔乔亚