的Apache 2.4.7重写规则
问题描述:
我有以下Apache网址重写规则的Apache 2.4.7重写规则
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/$
RewriteCond %{QUERY_STRING} ^_escaped_fragment_=/?(.*)$
RewriteRule ^(.*)$ /snapshots/%1? [NC,L]
[来源:http://www.yearofmoo.com/2012/11/angularjs-and-seo.html#detecting-the-search-engine]
这些网址升级到Apache 2.4.7之前的工作。 (我不确定我有哪个版本)。现在,在查询字符串中使用?_escaped_fragment=/
时,它总是加载主页。任何人都知道如何解决到Apache 2.4.7
UPDATE
目录结构
/.htaccess
/index.php
/partials/
/snapshots/
/css/
/js/
答
试试这个规则在Apache的2.4 +:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^_escaped_fragment_=/?(.*)$
RewriteRule ^/?$ /snapshots/%1? [L,QSD]
QSD
将丢弃后的查询字符串重定向。
对不起,没有运气与您的答案 – Gihan 2015-03-03 05:28:34
你是如何确实验证它不工作?同时提供完整的.htaccess问题,可能会有一些冲突的规则。 – anubhava 2015-03-03 07:47:35