Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between AddHandler and AddType in htaccess files

Can someone explain what the difference is between AddType and AddHandler in htaccess files? I want to make the settings such that I can have a javascript file (.js) be run through the server as though it were a php file (application/x-httpd-php5) but then sent to the user's browser as a (text/javascript) file. How might i configure this?

like image 464
NoodleOfDeath Avatar asked Jan 21 '23 07:01

NoodleOfDeath


1 Answers

AddHandler http://httpd.apache.org/docs/2.0/mod/mod_mime.html#addhandler tells the server how to handle the file type. AddType http://httpd.apache.org/docs/2.0/mod/mod_mime.html#addtype tells the server what MIME type to give the client.

like image 185
Caltor Avatar answered Jan 29 '23 13:01

Caltor