Currently, when I create a user, I automatically create a folder with user's ID, where his/her files will be stored. I need to add one more functionality. When a directory is created I need to create a file in that directory, possibly an index.html or .htaccess file that will redirect to the users's profile if some one attempts to view the index of that directory directly.
Currently:
domain.com/users/userID/userFiles/
Need to redirect:
domain.com/users/userID/index.php
How do I create a file?