Parse js/css as a PHP file using htaccess

前端 未结 6 1861
面向向阳花
面向向阳花 2020-12-10 07:36

Hi I have been trying so hard to do the following on htaccess but it does not seem to work.

can someone out there help me?

AddType application/x-httpd-

6条回答
  •  没有蜡笔的小新
    2020-12-10 07:50

    If you want to do this using just .htaccess configuration (who wants to set the headers in every PHP file?):

    
      SetHandler application/x-httpd-php
      Header set Content-type "text/css"
    
    
    
      SetHandler application/x-httpd-php
      Header set Content-type "application/javascript"
    
    

提交回复
热议问题