I wish to change all demands to some file using the extension .user.js to become designed to b .perl. I've this code:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule /([^/]*)\.user\.js$ $1.php [R,NC]

</ifModule>

That regrettably doesn't work. I understand mod_rewrite is loaded because, basically do that:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule /([^/]*)\.user\.js$ $1.php [R,NC]
s
</ifModule>

It returns a standing code of 500. And So I believe my problem is incorporated in the regex.
Illustration of things i want:

GET /foo/bar/preetyuserscript.user.js

becomes

GET /foo/bar/preetyuserscript.php

I believe this works:

RewriteRule ^(.*?)\.user\.js$ $1.php

Whether it does not and also you still see 500 errors take a look within the error log. Always the to begin with to look at.

Correct RewriteRule ought to be:

RewriteRule ^([^.]*)\.user\.js$ /$1.php [R,L,NC]