首页 \ 问答 \ 网站正在重定向与文档引用,它破坏了搜索引擎的结果(Website is being redirected with document referrer and it's ruining search engine results)

网站正在重定向与文档引用,它破坏了搜索引擎的结果(Website is being redirected with document referrer and it's ruining search engine results)

如果你搜索谷歌的“纽约州海滩清理”,你会看到第一个结果是网站http://najomawi.com ,但标题看起来不适合这样的网站。 您还会注意到,如果您点击此链接,它会转到您的Nike鞋子网站。 只有在您使用Google结果链接时才会发生这种情况(我相信它会发生在Bing,Yahoo等)。 如果您将http://najomawi.com直接放入浏览器栏,它会将您带到正确的站点。 困惑,我检查了页面源代码(都有'查看页面源'和Chrome的检查器),发现这个......

<script>
    var s=document.referrer;
    if(s.indexOf("google")>0 || s.indexOf("bing")>0 || s.indexOf("aol")>0 || s.indexOf("yahoo")>0)
    {
        self.location='http://www.theredkicks.com';
    }
</script>

我不知道这是怎么到达那里的。 它出现在主页的head标签中,即index.html。 没有PHP代码,没有其他JS,除了我知道的CSS样式表之外别无他法。 整个网站几乎都是静态的HTML和CSS表。 那么这是怎么做到的? 我怎么能摆脱它呢?


If you search on Google 'new york state beach cleanup', you'll see that the first result is for the website http://najomawi.com, but the title doesn't look quite right for such a site. You'll also notice that if you click this link it instead takes you to a website for Nike shoes. It only happens if you use the Google results link though (and I believe it happens in Bing, Yahoo and others). If you put http://najomawi.com directly into your browser bar, it takes you to the correct site. Confused, I checked the page source code (both with 'View Page Source' and Chrome's inspector) and found this...

<script>
    var s=document.referrer;
    if(s.indexOf("google")>0 || s.indexOf("bing")>0 || s.indexOf("aol")>0 || s.indexOf("yahoo")>0)
    {
        self.location='http://www.theredkicks.com';
    }
</script>

I have no idea how this got there. It appears in the the head tags of the home page, which is index.html. There is no PHP code, no other JS, nothing other than CSS stylesheets that I am aware of. The entire site is pretty much static HTML and CSS sheets. So how did this get there? And how can I get rid of it?


原文:https://stackoverflow.com/questions/21034155
更新时间:2021-03-16 16:03

最满意答案

在Prolog中N是N + 1总是假的,Prolog不是C,你必须写N1是N + 1,因为当N与一个值统一时,它不能被改变,所以N永远不等于N + 1 。 你的代码必须这样编写,必须在N的微积分之前调用递归。

find(_R1, _R2, [], [],0).

find(R1, R2, [[Mark, CName] | T], L,N):-
  find(R1, R2, T, L1,N1),
  ( (R1 =< Mark, Mark =< R2)
   ->  L = [CName | L1],N is N1+1
   ;   L = L1, N = N1).

[编辑]在你的帖子中,当你调用N是N + 1时N没有值,因为N在返回find(R1,R2,T,L1,N)之后得到一个值


N is N+1 is always false in Prolog , Prolog is not C, you MUST write N1 is N+1, because when N is unified with a value, it can't be changed, so N is never equal to N+1. Your code must be written like that, the recursion must be called before the calculus of N.

find(_R1, _R2, [], [],0).

find(R1, R2, [[Mark, CName] | T], L,N):-
  find(R1, R2, T, L1,N1),
  ( (R1 =< Mark, Mark =< R2)
   ->  L = [CName | L1],N is N1+1
   ;   L = L1, N = N1).

[EDIT] In your post, N has no value when you call N is N+1, because N gets a value after the return of the call of find(R1, R2, T, L1,N).

相关问答

更多

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。