【发布时间】:2017-04-28 12:39:01
【问题描述】:
我正在尝试使用 htaccess 重定向到文件,但无法显示图像。
我想将任何请求重定向到 mydomain.com 或 www.mydomain.com 到 www.mydomain.com/test.html
这是我的 htaccess 文件的内容:
# Turn rewriting on
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_URI} !=/test.html
RewriteCond %{REQUEST_URI} !=*\.png$ [NC]
RewriteRule .* /test.html
我的 test.html 文件中有这行代码:
<img src="image.png" alt="My Image">
但是图像根本不显示,我只是得到一个损坏的图像。我也尝试使用图像的绝对路径,同样的事情。
【问题讨论】: