繁体   English   中英

如何只允许一个域访问另一个域中的文件和文件夹

[英]how to only allow one domain to access files and folders in another domain

在其中有一组文件夹

/var/www/vhosts/abc/content.abc.com.au/httpdocs/文件夹

例如:

/var/www/vhosts/abc/content.abc.com.au/httpdocs/62199911-74c61aaf688c0d374f23253218a12a9b81eaba4c

/var/www/vhosts/abc/content.abc.com.au/httpdocs/62199911-74c61aaf688c0d374f23253218a12a9b81eab12d

我可以使用以下网址访问上述文件夹中的文件:

https://content.abc.com.au/62199911-74c61aaf688c0d374f23253218a12a9b81eaba4c/index.html https://content.abc.com.au/62199911-74c61aaf688c0d374f23253218a12a9b81eab12d/index.html

我想防止直接访问这些网址。

然后,

我在此(/var/www/vhosts/xyz/anothercontent.pqr.com.au)文件夹中还有另一个php文件,名为“ pdfview.php”。

我们可以使用以下网址访问文件: https ://abc.sample.com.au/pdfview.php“ pdfview.php”文件包含以下iframe:

<iframe src="https://content.abc.com.au/62199911-74c61aaf688c0d374f23253218a12a9b81eab12d/index.html" allowfullscreen="" style="width:100%;height:100%;" frameborder="0"></iframe>

我只想通过此( https://abc.sample.com.au )域中“ pdfview.php”页面中的iframe访问以下网址,而无需在任何其他域中进行访问。 https://content.abc.com.au/62199911-74c61aaf688c0d374f23253218a12a9b81eaba4c/index.html https://content.abc.com.au/62199911-74c61aaf688c0d374f23253218a12a9b81eab12d/index.html

我试图找到一种使用htaccess文件执行此操作的方法。 但不能。 有没有办法使用htaccess或使用php

如何修改.htaccess文件。

Order Deny,Allow
Deny from all
Allow from 100.100.100.100

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM