AoEiuV020 / Url-Shorten-Worker

A URL Shortener created using Cloudflare worker
https://020.name/
MIT License
271 stars 142 forks source link

自定义不同域名 #2

Open cgkings opened 2 years ago

cgkings commented 2 years ago

如果我现在有域名 myurl.com 如何实现 访问myurl.com为短连接主页,生成短连接格式 myurl.com/abcdef

cgkings commented 2 years ago

我查源代码的问题集,倒是解决了访问的问题,但是能访问myurl.com,转出来的短链接myurl.com/abcdef无法访问原地址,而是重定向到了https://dns.google/abcdef,然后提示google 404错误,具体信息如下: “404. 那是一个错误。 /abcdef 在此服务器上找不到请求的 URL 。 我们知道的就这些。”

另外,贴一下访问是怎么解决的: 把myurl.com加入cf,然后添加一个A记录,名称就是@,ip地址随意(比如8.8.8.8),启用代理(小云朵点亮);然后在worker里的http routes里将myurl.com引用到本项目的cf worker空间

crazypeace commented 1 year ago

你试试这个? 使用秘密路径访问操作页面。支持自定义短链。API 不公开服务。页面缓存设置过的短链。长链接文本框预搜索localStorage。增加删除某条短链的按钮。

演示页面 https://1ladder.eu.org/tiananmen

GitHub https://github.com/crazypeace/Url-Shorten-Worker/

搭建教程 https://zelikk.blogspot.com/2022/07/url-shorten-worker-hide-tutorial.html