问题的AddHandler htaccess的 [英] problem with AddHandler in htaccess

查看:226
本文介绍了问题的AddHandler htaccess的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有.htaccess文件包含此行

 < FilesMatch\ .js文件$>
    AddHandler的应用程序/ X的httpd  -  PHP的.js
< / FilesMatch>
 

它工作在我的本地主机,但它在我的主机不工作。 我认为问题是与mod_mime。 在本地主机我看到mod_mime的加载模块,但在我的主机(阿帕奇/ 2.2.16 PHP 5.3.3)我找不到加载模块,以检查它是否启用。

  1. 如何检查mod_mime是否 在加载模块?
  2. 如何加载 (启用)mod_mime htaccess的?
解决方案

也许你混淆了的AddHandler SetHandler ?它将使更多的意义,使用 SetHandler <文件> ;为的AddHandler 没有必要为您封闭的范围。

i have the .htaccess file included this line

<FilesMatch "\.js$">
    AddHandler application/x-httpd-php .js
</FilesMatch>

it works in my localhost but it doesnt work in my host. i think problem is with mod_mime. in localhost i see mod_mime in loaded module but in my host (Apache/2.2.16 php 5.3.3) i cant find loaded module to check if it is enable.

  1. how to check whether mod_mime is in loaded module?
  2. how to load (enable) mod_mime in htaccess?

解决方案

Perhaps you're confusing AddHandler with SetHandler? It would make more sense to use SetHandler in <Files>; for AddHandler there's no need for your enclosing scope.

这篇关于问题的AddHandler htaccess的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆