【问题标题】:Apache 2.4.7 rewrite rulesApache 2.4.7 重写规则
【发布时间】:2015-05-02 21:01:07
【问题描述】:

我有以下 Apache url 重写规则

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

更新

目录结构

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

【问题讨论】:

    标签: apache .htaccess mod-rewrite seo


    【解决方案1】:

    在 Apache 2.4+ 中试试这个规则:

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

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

    【讨论】:

    • 抱歉,您的回答不顺利
    • 您是如何实际验证它不工作的?还要提供有问题的完整 .htaccess,可能会有一些冲突的规则。
    猜你喜欢
    • 2011-09-02
    • 2011-10-26
    • 1970-01-01
    • 1970-01-01
    • 2020-02-27
    相关资源
    最近更新 更多