0

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?
4
  • Are you sure that Apache is able to use .htaccess file? Usually, by default, Apache is not configured to read configuration from .htaccess file Commented Jan 20, 2011 at 13:58
  • Try for instance to put a .htaccess file with the directive Deny from all. If it works you should get a 401 Unauthorized code Commented Jan 20, 2011 at 15:53
  • to list modules the command is apache2 -M or httpd -M Commented Jan 20, 2011 at 20:57
  • where do i enter apache2 -M in my shared host?more information please. Commented Jan 20, 2011 at 21:08

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

0

You can check if module loaded with

<IfModule mod_mime.c>
   ...
</IfModule>

but you cannot load a module from within .htaccess.

3 Comments

do you mean <FilesMatch "\.js$"><IfModule mod_mime.c> AddHandler application/x-httpd-php .js </IfModule> </FilesMatch> ?
Rather whole FilesMatch section inside IfModule
Well, of course, since I didn't provide a solution. I just answered your question about loading modules. The solution is just one string. AddHandler application/x-httpd-php .js

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.