Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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 2.4.7重写规则_Apache_.htaccess_Mod Rewrite_Seo - Fatal编程技术网

Apache 2.4.7重写规则

Apache 2.4.7重写规则,apache,.htaccess,mod-rewrite,seo,Apache,.htaccess,Mod Rewrite,Seo,我有以下Apache url重写规则 RewriteEngine On RewriteCond %{REQUEST_URI} ^/$ RewriteCond %{QUERY_STRING} ^_escaped_fragment_=/?(.*)$ RewriteRule ^(.*)$ /snapshots/%1? [NC,L] [来源:] 这些URL在升级到Apache2.4.7之前起作用。(我不确定我有哪个版本)。现在,当在查询字符串中使用?\u转义\u片段=/时,它总是加载主页。有人知道如

我有以下Apache url重写规则

RewriteEngine On
RewriteCond %{REQUEST_URI}  ^/$
RewriteCond %{QUERY_STRING} ^_escaped_fragment_=/?(.*)$
RewriteRule ^(.*)$ /snapshots/%1? [NC,L]
[来源:]

这些URL在升级到Apache2.4.7之前起作用。(我不确定我有哪个版本)。现在,当在查询字符串中使用
?\u转义\u片段=/
时,它总是加载主页。有人知道如何修复Apache2.4.7吗

更新

目录结构

/.htaccess
/index.php
/partials/
/snapshots/
/css/
/js/

在Apache 2.4+中尝试此规则:

RewriteEngine On

RewriteCond %{QUERY_STRING} ^_escaped_fragment_=/?(.*)$
RewriteRule ^/?$ /snapshots/%1? [L,QSD]

QSD
将在重定向后丢弃查询字符串。

抱歉,您的回答没有成功。您实际上是如何验证它不起作用的?另外,如果您提供完整的.htaccess,可能会有一些冲突的规则。