How to move and access a folder outside of the root folder
Posted on 2016-09-06
I have a connections folder that has a php file with the database connection details in it and then I include this file in any pages that require a database connection. I have heard that it is a good idea to move that folder out of the root but I don't know exactly where you would put it and how you would access it?
For example, I now have: ../connections/db.php
What would I change that to?
I am currently using a .htaccess file in the folder itself that has:
But, I think that moving the folder out of the root might be more secure?