2020-05-09 14:42:57 +00:00
<!doctype html>
< html >
< head >
2020-04-29 08:37:43 +00:00
< meta charset = "utf-8" >
2020-05-09 14:42:57 +00:00
< meta name = "viewport" content = "width=device-width, initial-scale=1" / >
2023-12-11 07:23:07 +00:00
2024-04-01 13:51:55 +00:00
< link rel = "stylesheet" href = "../style.css#" type = "text/css" / >
2023-04-12 05:56:43 +00:00
< title > 重定向网址< / title >
2022-06-30 03:43:09 +00:00
< script type = "text/javascript" >
2022-07-12 02:24:02 +00:00
function findLang(){
2022-06-30 03:43:09 +00:00
let href = location.href;
for(let i=href.length-1;i>0;i--){
if('/'==href.charAt(i) & & '/'==href.charAt(i-3))
2022-07-12 02:24:02 +00:00
return i;
2022-06-30 03:43:09 +00:00
}
2022-07-12 02:24:02 +00:00
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);
2022-06-30 03:43:09 +00:00
}
< / script >
2020-05-09 14:42:57 +00:00
< / head >
< body >
< header class = 'header' >
2024-04-02 05:42:43 +00:00
< 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-07-12 02:24:02 +00:00
2022-09-13 08:13:02 +00:00
< a class = "logo" href = "javascript:void(0)" onclick = "return nav2Lang('en')" > English< / a >
2020-05-09 14:42:57 +00:00
< nav >
< / nav >
< / header >
2020-08-29 00:42:46 +00:00
< br / >
2020-04-29 08:37:43 +00:00
2020-05-09 14:42:57 +00:00
< div class = "container" >
2023-04-12 05:56:43 +00:00
< h1 class = "title" > 重定向网址
2020-05-09 14:42:57 +00:00
< br >
< span class = "subtitle" > < / span >
< / h1 >
< ul class = "tags" >
2020-04-29 08:37:43 +00:00
2020-05-09 14:42:57 +00:00
< / ul >
2023-04-12 05:56:43 +00:00
< h4 id = "全局重定向" > 全局重定向< / h4 >
2024-04-08 01:01:20 +00:00
< p > 长按设置,选中" 自定义资源重定向" 。此时如果< a href = "i:60/data/data/info.torapp.uweb/files/config.html:https://jamesfengcao.codeberg.page/zh/searchurl/config.html" > 全局重定向url< / a > 为有效网址,< / p >
< ul >
< li > 且最后一个字符为'/'、'?'或'=', 则所有网络访问被内部重定向至url:< br >
" [全局重定向url]+[原始url]" 。< / li >
< li > 如果没有以上述字符结尾, 则意味着“光秃秃”。所有网络访问被内部重定向至url:< br >
" [全局重定向url]+'/'+[scheme]+'/'+[原始域名和路径]" < / li >
< / ul >
2024-03-17 04:23:44 +00:00
< p > Example: " https://loud-moth-21.deno.dev/" < / p >
2024-03-24 01:42:35 +00:00
< p > 使用仓库 " https://github.com/torappinfo/fetch" 入口" deno.js" < a href = "https://deno.com/deploy" > 部署Deno< / a > < / p >
2024-03-24 01:39:48 +00:00
< 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 >
2024-03-17 04:23:44 +00:00
< p > < a href = "../../en/searchurl/cloudflare/redirect.js" > cloudflare workers 全局重定向代码< / a > < br >
2023-06-17 01:56:11 +00:00
< a href = "https://github.com/torappinfo/vercel" > vercel 全局重定向< / a > < / p >
2023-04-12 05:56:43 +00:00
< h4 id = "重定向文件-defaultredirect-仅在无有效全局重定向url时生效" > 重定向文件 " default.redirect" (仅在无有效全局重定向url时生效)< / h4 >
2023-02-20 14:03:43 +00:00
< p > < a target = "_self" href = "i:0gdefault.redirect:../searchurl/txt/redirect.cfg" > 点击添加google recaptcha国内镜像< / a > < / p >
2022-04-10 09:46:08 +00:00
< p > 使用服务器在国外的搜索引擎体验往往不如国内的引擎。由于网站屏蔽的原因,两者之间索引权重差别很大。国外受欢迎的技术类网站因此难以在百度上搜到;国外引擎能搜到但由于其中不少结果无法访问而体验糟糕。< / p >
2020-04-29 08:37:43 +00:00
< p > 其实,很多技术类网站在国内早有镜像,但由于镜像并非众所周知,其索引权重在百度上微不足道,非专门搜索不可得。< / p >
< p > 本文介绍一种技术,可重定向国外网址至国内镜像,极大的提高国外引擎的体验,让更多用户更客观的理解全球技术。< / p >
2022-07-09 00:45:17 +00:00
< p > 配置default.redirect:< br >
2020-05-09 14:42:57 +00:00
文件每一行格式为:< br >
域名:正则表达式:替换表达式< / p >
2022-04-22 12:24:46 +00:00
< p > 其中正则表达式以java语言规定为准, 表达式中不能包含':'。正则表达式为空时系统默认为与域名相同。正则表达式,替换表达式同时为空时无重定向作用, 但域名会允许CORS跨域访问 (目前仅对" GET" request生效)。< / p >
2020-05-09 14:42:57 +00:00
< p > 例子文件内容如下:< br >
developer.android.com::developer.android.google.cn< / p >
2020-04-29 08:37:43 +00:00
< p > 四种使用重定向的方法:< / p >
< ul >
2020-05-09 14:42:57 +00:00
< li >
< p > 长按链接< br >
2022-07-09 00:45:17 +00:00
添加文件" 国内镜像.js" 至" longclick" 目录下。< br >
2020-05-09 14:42:57 +00:00
文件内容如下:< / p >
2020-04-29 08:37:43 +00:00
< pre > //e:%u< / pre >
2020-05-09 14:42:57 +00:00
< p > 其中" e:" 为uweb特殊url协议, 意为" edit" ,即" 编辑" 。当后面紧跟url网址的情况下会重定向网址。< / p >
< p > 重启uweb后长按链接弹出菜单选" 国内镜像" ,浏览器将访问网址的国内镜像。若网址为本地文件,则浏览器会自动调用此类文件编辑器。< / p >
< / li >
< li >
2024-04-02 11:38:45 +00:00
< p > < a href = "../urls/index.html#" > 长按工具条图像按钮< / a > 。< / p >
2020-04-29 08:37:43 +00:00
< / li >
2020-05-09 14:42:57 +00:00
< li >
< p > 长按设置,选中" 自定义重定向" 。< / p >
< / li >
< li >
< p > 长按设置,选中" 自定义资源重定向" 。此选项除访问url重定向之外, 还可重定向网页中一切资源。< / p >
2020-04-29 08:37:43 +00:00
< / li >
< / ul >
2020-05-09 14:42:57 +00:00
< p > 更多重定向网址:< br >
2024-03-04 03:03:48 +00:00
www.bilibili.com::www.ibilibili.com< br >
2020-05-09 14:42:57 +00:00
pan.baidu.com::pan.baiduwp.com< br >
2024-03-04 03:03:48 +00:00
www.docin.com::www.docin365.com< br >
2020-05-09 14:42:57 +00:00
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 >
2024-04-08 01:01:20 +00:00
< p > Last Modified: 7 April 2024< br >
more details on global redirection url< br >
2023-03-07 02:07:05 +00:00
< pre > < / pre >
< / p >
2024-03-21 01:04:37 +00:00
2023-05-06 01:56:44 +00:00
< script id = 'jsgiscus'
src='https://giscus.app/client.js'
data-repo="torappinfo/uweb"
data-repo-id="MDEwOlJlcG9zaXRvcnkzMDIyMDU3MjE="
data-category="Announcements"
data-category-id="DIC_kwDOEgNLGc4CQjsh"
2023-05-06 02:49:29 +00:00
data-mapping="title"
2023-05-06 01:56:44 +00:00
data-strict="0"
data-reactions-enabled="1"
data-emit-metadata="0"
data-input-position="top"
data-theme="light"
data-lang="en"
data-loading="lazy"
2023-05-06 02:49:29 +00:00
crossorigin="anonymous" async>
2023-05-06 01:40:28 +00:00
< / script >
2020-04-29 08:37:43 +00:00
2024-04-03 01:47:35 +00:00
< footer class = "site-footer" >
< div class = "container" >
2024-04-04 13:28:55 +00:00
© 2018-2024 Richard H. Cao
2024-04-03 01:47:35 +00:00
< / div >
< / footer >
2024-04-04 13:28:55 +00:00
<!-- 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/>. -->
2020-05-09 14:42:57 +00:00
< / body >
2020-04-29 08:37:43 +00:00
< / html >