在受密码保护的网站上,如何将某些引用域列入白名单?

发布于 2024-08-23 09:22:08 字数 166 浏览 2 评论 0原文

我有一个使用 .htaccess 和 .htpasswd 文件进行密码保护的网站。我希望用户只有来自某个域时才能绕过登录提示。可以通过以某种方式将 .htaccess 凭据作为参数嵌入到链接中来完成吗?

我确实管理要列入白名单的域,那么如何在 .htaccess 文件将处理的链接中传递 GET 参数?

I have a site that is password-protected using a .htaccess and .htpasswd file. I'd like for users to bypass the login prompt ONLY if they come from a certain domain. Can this be done by embedding the .htaccess credentials as parameters in the link somehow?

I do manage the domain I'd like to whitelist, so how can I pass GET parameters in the link that the .htaccess file will process?

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

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

发布评论

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

评论(2

淑女气质 2024-08-30 09:22:08

您应该重新考虑这一点,因为欺骗引用域(或来自客户端的任何信息)是微不足道的。

如果您愿意,您的用户可以轻松选择保存他们的用户名/密码。

You should rethink this as it is trivial to spoof the referring domain (or any information from the client).

You users can easily select to save their username / password if they wish to.

情绪少女 2024-08-30 09:22:08

这将是非常不安全的,http 引荐来源网址可以很容易地被操纵并且您的登录被绕过。

如果您拥有其他站点,您可以添加一些 http 标头或 GET var。如果您不这样做,请开始为您想做的事情考虑另一个解决方案。

That would be highly insecure, the http referrer can be easily manipulated and your login bypassed.

If you own the other sites you can add some http header or GET var. If you don't, start thinking another solution for what you want to do.

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