uweb/zh/redirect/index.html

106 lines
4.6 KiB
HTML
Raw Normal View History

<!doctype html>
<html>
<head>
2020-04-29 08:37:43 +00:00
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
2020-04-29 08:37:43 +00:00
<link rel="stylesheet" href="../style.css" type="text/css" />
<title>重定向网址至国内镜像</title>
<script type="text/javascript">
function findLang(){
let href = location.href;
for(let i=href.length-1;i>0;i--){
if('/'==href.charAt(i) && '/'==href.charAt(i-3))
return i;
}
return 0;
}
function nav2(page){
let i = findLang();
location.href = location.href.substring(0,i+1)+page;
}
function nav2Lang(lang){
let i = findLang();
let href = location.href;
location.href = location.href.substring(0,i-2)+lang+location.href.substring(i);
}
</script>
</head>
<body>
<header class='header'>
<a class="logo" href="javascript:void(0)" onclick="return nav2('index.html')">Home</a> <a class="logo" href="javascript:void(0)" onclick="return nav2('tags/index.html')">Tags</a>
2022-09-13 08:13:02 +00:00
<a class="logo" href="javascript:void(0)" onclick="return nav2Lang('en')">English</a>
<nav>
</nav>
</header>
<br />
2020-04-29 08:37:43 +00:00
<div class="container">
<h1 class="title">重定向网址至国内镜像
<br>
<span class="subtitle"></span>
</h1>
<ul class="tags">
2020-04-29 08:37:43 +00:00
<li><a href="../tags/%e9%87%8d%e5%ae%9a%e5%90%91">重定向</a> </li>
2020-04-29 08:37:43 +00:00
<li><a href="../tags/%e5%9b%bd%e5%a4%96%e7%bd%91%e5%9d%80">国外网址</a> </li>
2020-04-29 08:37:43 +00:00
</ul>
<p><a href="i:0gdefault.redirect::github.com::hub.fastgit.xyz%0A">github mirror:fastgit</a><br>
<a href="i:0gdefault.redirect::github.com::hub.0z.gs%0A">github mirror 2</a><br>
<a href="i:0gdefault.redirect::github.com::api.mtr.pub%0A">github mirror 3</a></p>
<p><a target="_self" href="i:0gdefault.redirect:http://fastly.jsdelivr.net/gh/torappinfo/uweb/zh/searchurl/txt/redirect.cfg">点击添加google recaptcha国内镜像</a></p>
<p>使用服务器在国外的搜索引擎体验往往不如国内的引擎。由于网站屏蔽的原因,两者之间索引权重差别很大。国外受欢迎的技术类网站因此难以在百度上搜到;国外引擎能搜到但由于其中不少结果无法访问而体验糟糕。</p>
2020-04-29 08:37:43 +00:00
<p>其实,很多技术类网站在国内早有镜像,但由于镜像并非众所周知,其索引权重在百度上微不足道,非专门搜索不可得。</p>
<p>本文介绍一种技术,可重定向国外网址至国内镜像,极大的提高国外引擎的体验,让更多用户更客观的理解全球技术。</p>
<p>配置default.redirect:<br>
文件每一行格式为:<br>
域名:正则表达式:替换表达式</p>
<p>其中正则表达式以java语言规定为准表达式中不能包含':'。正则表达式为空时系统默认为与域名相同。正则表达式,替换表达式同时为空时无重定向作用但域名会允许CORS跨域访问 (目前仅对&quot;GET&quot; request生效)。</p>
<p>例子文件内容如下:<br>
developer.android.com::developer.android.google.cn</p>
2020-04-29 08:37:43 +00:00
<p>四种使用重定向的方法:</p>
<ul>
<li>
<p>长按链接<br>
添加文件&quot;国内镜像.js&quot;&quot;longclick&quot;目录下。<br>
文件内容如下:</p>
2020-04-29 08:37:43 +00:00
<pre>//e:%u</pre>
<p>其中&quot;e:&quot;为uweb特殊url协议意为&quot;edit&quot;,即&quot;编辑&quot;。当后面紧跟url网址的情况下会重定向网址。</p>
<p>重启uweb后长按链接弹出菜单选&quot;国内镜像&quot;,浏览器将访问网址的国内镜像。若网址为本地文件,则浏览器会自动调用此类文件编辑器。</p>
</li>
<li>
2022-09-13 08:13:02 +00:00
<p><a href="../urls/index.html">长按工具条图像按钮</a></p>
2020-04-29 08:37:43 +00:00
</li>
<li>
<p>长按设置,选中&quot;自定义重定向&quot;</p>
</li>
<li>
<p>长按设置,选中&quot;自定义资源重定向&quot;。此选项除访问url重定向之外还可重定向网页中一切资源。</p>
2020-04-29 08:37:43 +00:00
</li>
</ul>
<p>更多重定向网址:<br>
<a href="https://www.bilibili.com::www.ibilibili.com">www.bilibili.com::www.ibilibili.com</a><br>
pan.baidu.com::pan.baiduwp.com<br>
<a href="https://www.docin.com::www.docin365.com">www.docin.com::www.docin365.com</a><br>
wenku.baidu.com::wenku.baiduvvv.com<br>
detail.tmall.com::detail.tmallvvv.com<br>
detail.m.tmall.com::detail.m.tmallvvv.com<br>
item.taobao.com::item.taobaovvv.com<br>
h5.m.taobao.com::h5.m.taobaovvv.com<br>
jd.com::jdvvv.com<br>
item.yhd.com::item.yhdvvv.com<br>
goods.kaola.com::goods.kaolavvv.com<br>
product.dangdang.com::product.dangdangvvv.com<br>
item.gome.com.cn::item.gomevvv.com.cn</p>
2020-04-29 08:37:43 +00:00
</div>
</body>
2020-04-29 08:37:43 +00:00
</html>