htaccess阻止jpg而不是jpeg

时间:2014-05-22 02:27:48

标签: .htaccess

我正在尝试允许访问目录中的所有图像。现在我只能显示PNG,而JPG显示一个破损的图标。如果我将绝对jpg链接放入地址栏,我会收到403错误。

绞尽脑汁试图让这个工作起来好几个小时。我显然遗漏了一些非常明显的东西。任何人都可以帮我解决这个问题吗?

这是htaccess文件,它位于目录中。 jpgs在目录/ img /中(我尝试将它们移动到目录中,但它们仍然没有加载)

Options +Indexes

<FilesMatch "(\.(png|jpg|gif)|~)$">
  Order allow,deny
  Allow From All
  Satisfy All
</FilesMatch>

2 个答案:

答案 0 :(得分:0)

尝试:<FilesMatch "(\.(png|jpg|gif)|~)$">

答案 1 :(得分:0)

Options +Indexes RewriteEngine on
<FilesMatch "(\.(png|jpg|jpeg|gif)|~)$"> Order allow,deny Allow From All Satisfy All
</FilesMatch>


将此文件发送到.htaccess文件夹,其中包含图像。