1

我正在尝试获得一个开放的搜索定义来处理子域。

我在 html 中添加了正确的行。

例子:

<%@ page isELIgnored="false" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>title</title>
   <link rel="search"
        type="application/opensearchdescription+xml"
        href="http://www.example.org/opensearch.xml"
        title="Example" />
</head>
<body>

</body>
</html>

在 opensearch.xml 中:

<?xml version="1.0" encoding="utf-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>Example</ShortName>
<Description>Search</Description>
<InputEncoding>UTF-8</InputEncoding>
<LongName>Search</LongName>
<Url type="text/html" method="get" template="http://www.example.org/search/{searchTerms}"/>
</OpenSearchDescription>

当我访问http://www.example.org时,搜索已正确添加到 Google Chrome 的多功能框设置中。触发器关键字变为“example.org”。

但是,当我访问在 中具有相同行的http://subdomain.example.org时,搜索添加了触发关键字“subdomain.example.org”而不是“example.org”。

有没有解决的办法?

我没有在http://www.opensearch.org/Specifications/OpenSearch/1.1的文档中找到有关如何设置触发器关键字的任何信息。

我如何将默认关键字更改为其他内容。我该怎么做?

4

0 回答 0