uweb1087: adaptive UI for AI
[uweb.git] / zh / redirect / index.html
blobe459f691a87dfa869fa42bfeba195fef5b487a7c
1 <!doctype html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1" />
6 <link rel="canonical" href="https://jamesfengcao.gitlab.io/uweb/zh/redirect/" />
8 <link rel="stylesheet" href="../style.css#" type="text/css" />
9 <title>重定向网址</title>
10 <script>
11 function findLang(){
12 let href = location.href;
13 for(let i=href.length-1;i>0;i--){
14 if('/'==href.charAt(i) && '/'==href.charAt(i-3))
15 return i;
17 return 0;
19 function nav2(page){
20 let i = findLang();
21 location.href = location.href.substring(0,i+1)+page;
23 function nav2Lang(lang){
24 let i = findLang();
25 let href = location.href;
26 location.href = location.href.substring(0,i-2)+lang+location.href.substring(i);
28 </script>
29 </head>
30 <body>
31 <header class='header'>
32 <a class="logo" href="javascript:void(0)" onclick="return nav2('index.html#')">首页</a> <a class="logo" href="javascript:void(0)" onclick="return nav2('tags/index.html#')">标签</a>
35 <a class="logo" href="javascript:void(0)" onclick="return nav2Lang('en')">English</a>
38 <nav>
39 </nav>
40 </header>
41 <br />
43 <div class="container">
44 <h1 class="title">重定向网址
45 <br>
46 <span class="subtitle"></span>
47 </h1>
48 <ul class="tags">
50 </ul>
51 <p>⚠️<span style="color:red">重定向转发cookie</span>设置选项可允许登录情况下操作全局重定向下的网站,请确认全局重定向网址安全可靠,谨慎使用。</p>
52 <h4 id="全局重定向">全局重定向</h4>
53 <p>长按设置,选中&quot;自定义资源重定向&quot;。此时如果<a href="i:60/data/data/info.torapp.uweb/files/config.html:https://jamesfengcao.codeberg.page/zh/searchurl/config.html">全局重定向url</a>为有效网址,</p>
54 <ul>
55 <li>且最后一个字符为'/'、'?'或'=',则所有网络访问被内部重定向至url:<br>
56 &quot;[全局重定向url]+[原始url]&quot;</li>
57 <li>如果没有以上述字符结尾,则意味着“光秃秃”。所有网络访问被内部重定向至url:<br>
58 &quot;[全局重定向url]+'/'+[scheme]+'/'+[原始域名和路径]&quot;</li>
59 </ul>
60 <p>Example: &quot;https://muweb.pages.dev/redirect?&quot;</p>
61 <p>使用仓库 &quot;https://github.com/torappinfo/fetch&quot; 入口&quot;deno.js&quot; <a href="https://deno.com/deploy">部署Deno</a></p>
62 <p><a href="https://gitee.com/jja8/NewBingGoGo.wikis/blob/master/%E5%88%9B%E5%BB%BA%E9%AD%94%E6%B3%95%E9%93%BE%E6%8E%A5/%E4%BD%BF%E7%94%A8%E5%85%8D%E8%B4%B9%E7%9A%84%E7%9A%84%E4%BA%91%E6%9C%8D%E5%8A%A1%E6%8F%90%E4%BE%9B%E5%95%86%E5%88%9B%E5%BB%BA%E9%AD%94%E6%B3%95%E9%93%BE%E6%8E%A5.md">创建免费重定向,说明类似但代码不同</a></p>
63 <p><a href="../../en/searchurl/cloudflare/redirect.js">cloudflare workers 全局重定向代码</a><br>
64 <a href="https://github.com/torappinfo/vercel">vercel 全局重定向</a></p>
65 <p>使用仓库 &quot;https://github.com/torappinfo/redirect.genez&quot; <a href="https://genez.io">部署genez.io</a></p>
66 <p>允许从cloudflare访问的AI引擎有:<br>
67 <a href="https://devv.ai">devv.ai</a><br>
68 <a href="https://duckduckgo.com?ia=chat&amp;q=hi">duck AI</a></p>
69 <h4 id="重定向文件-defaultredirect-仅在无有效全局重定向url时生效">重定向文件 &quot;default.redirect&quot; (仅在无有效全局重定向url时生效)</h4>
70 <p><a target="_self" href="i:0gdefault.redirect:../searchurl/txt/redirect.cfg">点击添加google recaptcha国内镜像</a></p>
71 <p>使用服务器在国外的搜索引擎体验往往不如国内的引擎。由于网站屏蔽的原因,两者之间索引权重差别很大。国外受欢迎的技术类网站因此难以在百度上搜到;国外引擎能搜到但由于其中不少结果无法访问而体验糟糕。</p>
72 <p>其实,很多技术类网站在国内早有镜像,但由于镜像并非众所周知,其索引权重在百度上微不足道,非专门搜索不可得。</p>
73 <p>本文介绍一种技术,可重定向国外网址至国内镜像,极大的提高国外引擎的体验,让更多用户更客观的理解全球技术。</p>
74 <p>配置default.redirect:<br>
75 文件每一行格式为:<br>
76 域名:正则表达式:替换表达式</p>
77 <p>其中正则表达式以java语言规定为准,表达式中不能包含':'。正则表达式为空时系统默认为与域名相同。正则表达式,替换表达式同时为空时无重定向作用,但域名会允许CORS跨域访问 (目前仅对&quot;GET&quot; request生效)。</p>
78 <p>例子文件内容如下:<br>
79 developer.android.com::developer.android.google.cn</p>
80 <p>四种使用重定向的方法:</p>
81 <ul>
82 <li>
83 <p>长按链接<br>
84 添加文件&quot;国内镜像.js&quot;&quot;longclick&quot;目录下。<br>
85 文件内容如下:</p>
86 <pre>//e:%u</pre>
87 <p>其中&quot;e:&quot;为uweb特殊url协议,意为&quot;edit&quot;,即&quot;编辑&quot;。当后面紧跟url网址的情况下会重定向网址。</p>
88 <p>重启uweb后长按链接弹出菜单选&quot;国内镜像&quot;,浏览器将访问网址的国内镜像。若网址为本地文件,则浏览器会自动调用此类文件编辑器。</p>
89 </li>
90 <li>
91 <p><a href="../urls/index.html#">长按工具条图像按钮</a></p>
92 </li>
93 <li>
94 <p>长按设置,选中&quot;自定义重定向&quot;</p>
95 </li>
96 <li>
97 <p>长按设置,选中&quot;自定义资源重定向&quot;。此选项除访问url重定向之外,还可重定向网页中一切资源。</p>
98 </li>
99 </ul>
100 <p>更多重定向网址:<br>
101 www.bilibili.com::www.ibilibili.com<br>
102 pan.baidu.com::pan.baiduwp.com<br>
103 www.docin.com::www.docin365.com<br>
104 wenku.baidu.com::wenku.baiduvvv.com<br>
105 detail.tmall.com::detail.tmallvvv.com<br>
106 detail.m.tmall.com::detail.m.tmallvvv.com<br>
107 item.taobao.com::item.taobaovvv.com<br>
108 h5.m.taobao.com::h5.m.taobaovvv.com<br>
109 jd.com::jdvvv.com<br>
110 item.yhd.com::item.yhdvvv.com<br>
111 goods.kaola.com::goods.kaolavvv.com<br>
112 product.dangdang.com::product.dangdangvvv.com<br>
113 item.gome.com.cn::item.gomevvv.com.cn</p>
115 </div>
116 <p>Last Modified: 12 December 2024<br>
117 cleanup<br>
118 <pre></pre>
119 </p>
121 <script id='jsgiscus'
122 src='https://giscus.app/client.js'
123 data-repo="torappinfo/uweb"
124 data-repo-id="MDEwOlJlcG9zaXRvcnkzMDIyMDU3MjE="
125 data-category="Announcements"
126 data-category-id="DIC_kwDOEgNLGc4CQjsh"
127 data-mapping="title"
128 data-strict="0"
129 data-reactions-enabled="1"
130 data-emit-metadata="0"
131 data-input-position="top"
132 data-theme="light"
133 data-lang="en"
134 data-loading="lazy"
135 crossorigin="anonymous" async>
136 </script>
138 <footer class="site-footer">
139 <div class="container">
140 &copy; 2018-2024 Richard H. Cao
141 </div>
142 </footer>
143 <!-- This document is licensed under the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is available at <https://www.gnu.org/licenses/>. -->
146 </body>
147 </html>