Kagi 产品技巧 – 使用网址重定向自定义搜索结果
Kagi Product Tips – Customize Your Search Results with URL Redirects

原始链接: https://blog.kagi.com/tips/redirects

## Kagi URL 重定向:掌控你的搜索结果 Kagi 的 URL 重定向功能让用户可以自定义搜索结果的跳转目标,绕过不需要的网站版本或重定向。这个强大的工具允许你在点击*之前*创建 URL 的“查找和替换”规则,确保你到达你偏好的位置。 **工作原理:** 你定义规则,例如 `原始 URL | 目标 URL`。 **实用用途包括:** * **域名替换:** 切换到你偏好的网站版本(例如,旧 Reddit)。 * **路径替换:** 将结果固定到特定的文档版本。 * **绕过 AMP:** 直接访问原始来源,避免 Google 的 AMP 缓存。 重定向支持正则表达式进行高级模式匹配。Kagi 会直观地显示 URL 是否已被重写,让你能够查看原始链接和应用的规则。 Kagi 社区分享了许多有用的重定向,包括 Imgur、Twitter/X、YouTube 和 Goodreads 的替代方案。此功能为你的搜索体验提供了显著的控制和个性化程度。

对不起。
相关文章

原文

If you've ever clicked on a search result only to land on a version of a site you don't prefer, Kagi's URL Redirects (also known as URL Rewrites) puts you in control by automatically rewriting search result URLs before you even click them.

URL Redirects are a powerful Kagi feature that lets you set up textual find-and-replace rules for search result URLs. When a search result matches one of your rules, Kagi rewrites the URL so you always land exactly where you want to.

Here are three practical ways to use it:

1. Replace Domain

Want to always visit the old Reddit interface instead of the redesign? Or prefer an alternative frontend for a service? With a simple domain-level redirect, you can swap one domain for another across all search results:

FindReplace
reddit.comold.reddit.com

2. Replace in Path

Sometimes it's not the whole domain that you want a redirect for, it's a specific path segment. This is particularly useful if a project moved its docs and search engines still index the old location, or you want to pin results to a specific version of documentation:

FindReplace
/docs/v2//docs/v3/

3. Redirect AMP sites to their original URL

AMP (Accelerated Mobile Pages) is a Google-backed web framework that creates stripped-down versions of web pages designed to load faster on mobile devices, often served from Google's own cache rather than the original publisher's server. Google's AMP pages may show up in search results with mangled URLs that route through Google's cache. With Kagi Redirects, you can strip the AMP wrapper and go straight to the original source:

FindReplace
https://www.google.com/amp/s/https://

How do they work?

Each redirect rule follows a simple format: two URLs separated by a pipe character |:

^URL you want to change | URL you want to go to instead

For example, say you prefer viewing Bluesky posts through Witchsky, an alternative frontend. You'd add this rule:

^https://bsky.app|https://witchsky.app

When a redirect is active on a search result, Kagi displays a small icon letting you know the URL was rewritten, and you can hover over it to see the original URL and the rule that changed it:

Examples shared by the community

We asked the Kagi community to share their favorite redirect rules, and they delivered. Here's a collection of redirects to get you started. Just copy any rule into your Redirect settings in the format shown above and you're good to go.

Original URLRedirectPurpose
https://reddit.comhttps://old.reddit.comClassic Reddit layout without the redesign
https://imgur.comhttps://rimgo.bcow.xyzAn alternative frontend for Imgur with no ads or trackers
https://x.comhttps://xcancel.comPrivacy-friendly Twitter/X frontend, no login required
https://bsky.apphttps://witchsky.appAlternative Bluesky frontend
https://www.youtube.comhttps://skipcut.comSkip intros and filler in YouTube videos
https://www.npmjs.comhttps://npmx.devFast, modern browser for the npm registry
https://www.curseforge.comhttps://legacy.curseforge.comClassic CurseForge layout, cleaner browsing for Minecraft mods and modpacks
https://www.goodreads.comhttps://biblioreads.eu.orgPrivacy-friendly Goodreads frontend, works for direct book and author pages only
https://en.m.wikipedia.orghttps://en.wikipedia.orgForce desktop Wikipedia instead of mobile (full layout with sidebars, table of contents, and editing tools)

Always land on the latest docs

The match pattern supports regex (regular expressions), which lets you do fancier things like match multiple URL patterns or capture parts of the URL to rearrange them. For example, this rule always redirects you to the latest Knot DNS docs, no matter which version the search result links to:

^https://www.knot-dns.cz/docs/(?:[^/]+)/(.*)|https://www.knot-dns.cz/docs/latest/$1

Here, (.*) captures everything after the version number, and $1 pastes it into the new URL. So a link to /docs/3.2/configuration becomes /docs/latest/configuration.

Thanks to Thomas Jensen for this tip!

See it in action

Check out this quick demo to view the full process of creating a URL redirect and how it functions once implemented:

What users say about the utility of URL redirects

Collage of seven social media posts on a yellow-orange background, featuring users praising Kagi Search's URL redirect rules feature. Users share screenshots and examples of rewriting links to privacy-friendly alternatives like Breezewiki, Redlib, and Nitter, redirecting outdated documentation to current versions, and replacing YouTube and Fandom URLs with preferred alternatives, all without browser extensions.

Our help docs have more information for anyone looking to dig deeper. Found a clever use case of your own? Share it with the community and tag us!

联系我们 contact @ memedata.com