update AI engines
[uweb.git] / en / redirect / index.html
blobb7cdadf1f071f9a75fb237f65fc9f6f87afef794
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/en/redirect/" />
8 <link rel="stylesheet" href="../style.css#" type="text/css" />
9 <title>Resource redirection</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#')">Home</a> <a class="logo" href="javascript:void(0)" onclick="return nav2('tags/index.html#')">Tags</a>
35 <a class="logo" href="javascript:void(0)" onclick="return nav2Lang('zh')">简体中文</a>
38 <nav>
39 </nav>
40 </header>
41 <br />
43 <div class="container">
44 <h1 class="title">Resource redirection
45 <br>
46 <span class="subtitle"></span>
47 </h1>
48 <ul class="tags">
50 <li><a href="../tags/redirection/index.html#">redirection</a> </li>
52 </ul>
53 <p>⚠️<span style="color:red">Redirection forwards cookies</span> with the setting option &quot;Redirect cookies&quot; enabled, so use the option with care.</p>
54 <h4 id="setting-options-url-redirection-vs-resource-redirection">Setting options: &quot;Url redirection&quot; vs. &quot;Resource redirection&quot;</h4>
55 <p>&quot;Url redirection&quot; redirects the main/page url only while &quot;Resource redirection&quot; is for all urls in the page.</p>
56 <h4 id="global-redirection">Global redirection</h4>
57 <p><a href="i:60/data/data/info.torapp.uweb/files/config.html:https://jamesfengcao.codeberg.page/en/searchurl/config.html">Global redirection</a> is enabled with the setting option &quot;Resource redirection&quot; or both &quot;Url redirection&quot; and &quot;Redirect cookies&quot;.</p>
58 <p>When a valid global redirection url is set, the &quot;default.redirect&quot; has no effect, and any url resource is fetched with the new url by appending the original url to the global redirection url.</p>
59 <ul>
60 <li>
61 <p>If the global redirection url ends with '/', '?', or '=', then the resource is fetched with by the url &quot;[global redirection url] + [url]&quot;. For example, &quot;https://domain.com/pathXXX/https://cnn.com&quot;.</p>
62 </li>
63 <li>
64 <p>(to provide more options to users) If the global redirection url does not end with '/', '?' or '=', it means the global redirection url is naked. then the resource is fetched with by the url &quot;[global redirection url] + '/'+ [scheme]+ '/' + [url without scheme]&quot;. For example, when the global redirection url is &quot;https://domain.com/pathXXX&quot;, the real url to visit &quot;https://cnn.com&quot; is &quot;https://domain.com/pathXXX/https/cnn.com&quot;.</p>
65 </li>
66 </ul>
67 <p>Example: &quot;https://muweb.pages.dev/redirect?&quot;</p>
68 <p><a href="searchurl/cloudflare/redirect.js">global redirection code for cloudflare worker</a> free deployment: The global redirection url is &quot;https://name.username.workers.dev/&quot;, which is just the worker's domain name.</p>
69 <h4 id="defaultredirect-valid-only-without-global-redirection-url">&quot;default.redirect&quot; (valid only without global redirection url)</h4>
70 <p>Click the following links to append mirrors to the file &quot;default.redirect&quot;:<br>
71 <a target="_self" href="i:0gdefault.redirect:../../zh/searchurl/txt/redirect.cfg">google recaptcha mirror</a></p>
72 <p>Each line of the file &quot;default.redirect&quot; has the following format:<br>
73 [domain name]:[regular expression]:[replacement expression]</p>
74 <p>in which &quot;[regular expression]&quot; is as defined by java language, and cannot have &quot;:&quot; inside; if empty, it defaults to be same as &quot;[domain name]&quot;.</p>
75 <h5 id="ways-to-enable-domain-redirection">Ways to enable domain redirection:</h5>
76 <ul>
77 <li><a href="../urls/index.html#">Long pressing the image button</a></li>
78 <li>Long pressing the setting button, enable the option &quot;url redirection&quot;.</li>
79 <li>Long pressing the setting button, enable the option &quot;Resource redirection&quot;.</li>
80 </ul>
82 </div>
83 <p>Last Modified: 28 December 2024<br>
84 update AI engines<br>
85 <pre></pre>
86 </p>
88 <script id='jsgiscus'
89 src='https://giscus.app/client.js'
90 data-repo="torappinfo/uweb"
91 data-repo-id="MDEwOlJlcG9zaXRvcnkzMDIyMDU3MjE="
92 data-category="Announcements"
93 data-category-id="DIC_kwDOEgNLGc4CQjsh"
94 data-mapping="title"
95 data-strict="0"
96 data-reactions-enabled="1"
97 data-emit-metadata="0"
98 data-input-position="top"
99 data-theme="light"
100 data-lang="en"
101 data-loading="lazy"
102 crossorigin="anonymous" async>
103 </script>
105 <footer class="site-footer">
106 <div class="container">
107 &copy; 2018-2025 Richard H. Cao
108 </div>
109 </footer>
110 <!-- 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/>. -->
113 </body>
114 </html>