L
L
lightalex2016-04-19 17:13:45
PHP
lightalex, 2016-04-19 17:13:45

How to create a CNC for files of a specific extension?

Hello!
Tell me, kind people, how to create a CNC in access for files of a certain extension?
I tried to find it, but I found it for all files, not for a specific extension
A little more detail:
There are .js files scattered throughout the hosting
It is necessary that all requests for js files be redirected to the script.php file? url = [here should be the address to the page] which lies in the root of the site
Contents of the script.php file:

<?php
include($_GET['url']);
?>

That is, when requesting site.ru/js/jquery.js, the request will go to site.ru/script.js?url=js/jquery.js
Please tell me who knows how to implement this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
gents, 2016-04-19
@gents

RewriteEngine on
RewriteRule ^js/(.*)\.js$ /script.php?url=$1

But I strongly do not recommend using this application structure) I do not recommend it very much)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question