如何防止文件直接访问URL?
我正在使用Apache,我在我的本地主机,比如:
http://localhost/test/
中的文件test文件夹:
test
index.html sample.jpg .htaccess
样本来源index.html:
index.html
<html> <body> <img src="sample.jpg" /> </body> </html>
当我在http://localhost/test/,它将简单地显示页面上的图像“sample.jpg”。
问题:
http://localhost/test/sample.jpg
注: 当在每个浏览器上进行测试时,我发现下面的解决方案是有效的。除了火狐.
千万里不及你
相关分类