gpt4 book ai didi

Apache 2.4.7 重写规则

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:44:32 26 4
gpt4 key购买 nike

我有以下 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 ]

这些 url 在升级到 Apache 2.4.7 之前有效。 (我不确定我有哪个版本)。现在它总是在查询字符串中使用 ?_escaped_fragment=/ 时加载主页。任何人都知道如何修复 Apache 2.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 将在重定向后丢弃查询字符串。

关于Apache 2.4.7 重写规则,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28810992/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com