【发布时间】:2015-12-29 12:25:58
【问题描述】:
我正在尝试将 htaccess 规则重写为 nginx 规则。 此规则用于为机器人(如谷歌机器人)加载 php 页面。
这里是我的 htaccess:
RewriteCond %{HTTP_HOST} ^localhost$ [NC]
RewriteCond %{REQUEST_URI} ^/faq/$
RewriteCond %{QUERY_STRING} ^(.*)_escaped_fragment_=(.*)$
RewriteRule ^(.*)$ /files/snapshot_loader.php?snapshot_page=%1%2 [L]
你能帮帮我吗?我试试这个,但重定向永远不会工作....
location /faq {
if ($query_string ~ "^(.*)test(.*)$"){
RewriteRule ^(.*)$ http://www.google.com permanent
}
}
提前致谢
【问题讨论】: