You need to write a rule in htaccess, which replaces a specific .js file with .php. I tried to prescribe something like that

RewriteRule ^/js/index.php/x.js ^.*\.php 

But it does not work. There is a ready solution, but for nginx

 location = /js/index.php/x.js { rewrite ^(.*.php)/ $1 last; } 
  • Wanguee, that it took to run PHP inside a JS script in a certain directory and the author really wants AddHandler x-httpd-php .js - AK
  • @AK is not (I’m just in the request, the X-Content-Type-Options: nosniff is in the box and reads my JS as text and cannot execute. - Pavel Kushnerevich

0