I have a system where user pay for support, each user have a folder. I have many (like 200+) sub folderד in my website, each of these needs the CSS, images, JS etc...
I also create folders every week for new users when they register, each user can upload PHP script or JS script or images. (screenshot of their problem)
My problem is: in my /.htacess, I have a rule that checks for PHP script and redirects to the proper page e.g. site.com/user/page will go to site.com/user/page.php
What I want to do is prevent the user from breaking the system, for example by:
site.com/user/upload/test will go to his test.php and run it.
How can I prevent these kind of attacks?