【发布时间】:2012-05-01 11:27:45
【问题描述】:
我正在使用 Apache,并且我的 本地主机 上有一个示例 Web 文件夹,例如:
http://localhost/test/
test 文件夹中的文件:
index.html
sample.jpg
.htaccess
index.html的示例来源:
<html>
<body>
<img src="sample.jpg" />
</body>
</html>
当我在http://localhost/test/ 运行网站时,它只会在页面上显示图像“sample.jpg”。
问题:
- 我想防止图片直接在网址栏中显示为
http://localhost/test/sample.jpg。
注意: 我发现以下解决方案在Firefox 除外的所有浏览器上测试时都有效。
【问题讨论】:
标签: regex apache .htaccess mod-rewrite hotlinking