When accessing a * .php lead to autostart.php? url = *. php

0

Hello,

I'm having a problem, I need to access a file with .php , it should point to autostart.php?url=*.php

Explanation:

No autostart.php it includes in a file and after it includes include in the page that is in GET .

I did this with HTACCESS, but I could not make it work as I wanted.

<IfModule mod_rewrite.c>
    RewriteEngine on

    RewriteRule .*\.(php)$ autostart.php?url=$1 [R,NC,L]
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d
</IfModule>
    
asked by anonymous 12.01.2015 / 13:01

1 answer

0

Solution:

RewriteEngine on

RewriteRule (.*\.php)$ autostart.php?url=$1 [R,NC,L]
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d

I do not think it's a good idea to use this method to do include files. If php's allow_url_include option is enabled you have just opened a gap gigantic on your system that will allow anyone to inject and run a php script on your server.

If you're really doing this do not include include in the url parameter directly before doing a validation to see if the file can actually be included in your script .

    
12.01.2015 / 15:00