一般来说,问题是:如何将外部下载链接屏蔽为内部链接,并且只能由登录的 wp 用户在 htaccess 级别或使用 PHP 脚本访问?我们的外部 URL 有基于 Perl 的脚本,它会生成不同的下载 URL。如果您帮助我们如何在外部网站上应用它,我们可以这样做。
www.ourwebsite.com/resources
我们通过简单的 htaccess 代码成功重定向到外部下载链接:
Redirect 301 /resources https://external.com/direct-download-link1
但是,如果 URL(www.ourwebsite.com/resources/download-1.html 等)被 WordPress 会员抓取并在他们未登录时分享并粘贴到他们的浏览器地址栏中,则仍然可以访问下载链接. 我们想阻止它。那么如何禁止非会员直接访问下载链接呢?