I am trying to serve a JavaScript response from a JavaScript request using PHP.
Assuming that the request is embedded into the HTML source as
<script type=\"text/javascript\" src=\"http://www.mydomain.com/generatejs.js\" charset=\"UTF-8\"></script>
And i have a PHP script that is called generatejs.js.php which outputs more JavaScript code
The Apache rewrite condition/rule are
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^\.]+)$ $1.php [NC,L]
But I am getting a 404 when trying to access http://www.mydomain.com/generatejs.js. Can someone please help me with the missing bit? :)