icefog 发表于 2019-1-9 21:22:06

nginx怎么判断来路是搜索引擎还是直接输入的?

我也不知道,得问论坛的大佬。

我是谁我在哪 发表于 2019-1-9 21:24:30

检测refer啊

勇气 发表于 2019-1-9 21:28:04

可以判断 refer 像网址或关键词 最简单

[*]if ($http_referer ~* baidu.com ) {
[*]rewrite ^(.*)$ /baidu.html permanent;
[*]}复制代码

以上为最简单的,判断来路是百度,301到baidu.html

icefog 发表于 2019-1-9 21:41:57

检测refer,还可以检测到是不是呗采集了

小夜 发表于 2019-1-9 21:44:25

我以前用js
页: [1]
查看完整版本: nginx怎么判断来路是搜索引擎还是直接输入的?