相关疑难解决方法(0)

mod_rewrite之后的jpg文件的HTTP头

我正在使用Apache mod_rewrite将JPG文件的请求路由到我的Web根目录之外的目录.

它通常很好,但有一些图像不显示.然后我意识到当我get_headers()在我的图像URL上使用PHP的函数时,它们都返回
Content-Type: text/html; charset=UTF-8而不是正确的image/jpeg头类型.

我已经尝试明确设置Content-Type: image/jpeg标题,但仍然没有我的图像返回正确的标题 - 虽然大多数确实正确显示,但我不知道为什么.

如何确保在重定向时通过正确的标头发送JPG文件mod_rewrite

php apache mod-rewrite jpeg header

3
推荐指数
2
解决办法
2万
查看次数

标签 统计

apache ×1

header ×1

jpeg ×1

mod-rewrite ×1

php ×1