I have “inherited” some unfinished PHP projects that I am trying to sort out. All the projects reside on the charity’s web server host with the structure:
public_html (website.uk)
project1.website.uk
project2.website.uk
project3.website.uk
project4.website.uk
etc.
Currently each project has its own folders for js, css, images.fonts etc.
There are 5 projects and in nearly all of them there are duplicated files in the :folders (e.g. every project uses Bootstrap, JQuery, DataTables, PHPMailer)
I am trying to work out how to organise everything so that all the projects use just files from just one set of those folders
Two questions.
I anticipate creating the various folders (js/css/fonts etc) at the same level of the above - is this ok?
Is there an accepted way of pointing to those replaced folders in PHP other than replacing
<script src = "js/jquery.min.js" ></script
>
with <
<script src = "../js/jquery.min.js" ></script>
etc.?
On the system I am currently working on I have moved all the individual and calls into a single include file, called from within a php block in the HTML code, to make it easier to alter only one file than 50 or 60 modules!
Sorry if this is quite basic but haven’t been able to find understandable, or consistent, advice on web searches.
Thanks