I have a folder which contain HTML, CSS, JS, image files across various folders. For security reasons I want to place it outside the web root.
I have come across a solution using file_get_contents
function of PHP.
But then there is a problem with hyper-linking present in the page. For example, the link to the javascript file in the page:
<script src="lms/APIConstants.js" type="text/javascript"></script>
searches for the file in http://localhost/lms/APIConstants.js
and returns an error of
Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost/lms/APIConstants.js
I am aware of using .htaccess file for hiding some folders from the web root. I am looking for some other insightful solution.