托管文件的 URL 重定向(对于短 URL 服务)

发布于 2024-12-28 19:19:26 字数 280 浏览 2 评论 0原文

我有一个包含 YOURLS URL 缩短的 URL。目前,当您访问该网站时,您会得到所有 YOURLS 文件的文件列表(这并不理想)。

我想做一个重定向,这样如果人们访问该网站地址,他们可以被重定向到其他地方(因为这不会是公共服务)。

我由 Dreamhost 托管,他们已经拥有子域“WWW”的 A 名称记录,因此我无法为此添加另一个 A 名称记录。另外 Dreamhost 建议我只能使用 DNS 并删除托管,但显然我需要托管来托管 YOURLS 文件。我已经放弃了他们的支持团队,所以希望这里有人可以帮助我!

I have a URL with YOURLS URL shortening hosted on it. Currently when you visit the site you get a file list of all the YOURLS files (which is not ideal).

I would like to do a redirect so if people visit the site address they can be redirected elsewhere (as this won't be a public service).

I am hosted with Dreamhost and they already have a A-name record for the subdomain 'WWW' so I cannot add another A-name record for this. Also Dreamhost have advised that I could use DNS only and remove the hosting but obviously I need the hosting to host the YOURLS files. I have given up on their support team so hopefully someone here can help me!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

彡翼 2025-01-04 19:19:26

您可以使用 .htaccess 文件来满足您的需求。

您可以使用它来拒绝目录列表,请参阅此处的答案。它会给访问者 www.yourdomain.whatever 一个错误(访问被拒绝 IIRC)

或者如果你真的要将他们重定向到其他地方,你可以尝试 这个答案对您有帮助。请注意,这会将用户从一个选定页面重定向到另一页面。

You could use a .htaccess file to suit your needs.

You can use it to deny directory listing, see the answer here. It will give visitors to www.yourdomain.whatever an error (access denied IIRC)

Or if you really to redirect them somewhere else you can try if this answer is helping you. Note that this redirects the user from one selected page to another.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文