【发布时间】:2017-10-01 19:44:14
【问题描述】:
我想知道是否可以在 .htaccess 文件中设置重定向,这样如果另一个网站直接链接到我网站上的图像,而不是在浏览器窗口中打开图像,显示图片所在的页面。
此页面与图片同名,即如果其他网站链接到的图片是
案例1
www.example.com/subdirABC/gallery/image.jpg
**to**
www.example.com/subdirABC/
**or**
www.example.com/subdirABC/index.php
案例2
www.example.com/subdirXYZ/gallery/image.jpg
**to**
www.example.com/subdirXYZ/
**or**
www.example.com/subdirXYZ/index.php
【问题讨论】: