How to divide a website into four projects?

first introduce the environment
Linode ubuntu16.04,apapche,php7.3,mariadb

current dilemma
in my website folder, strictly speaking, there are three kinds of projects, one is e-commerce, one is blog, and the other is front-end and background
. But now a problem is that
shares a lot of files, including css,js
if I only share files separately without separating css,js first, how can I divide them?

the method I think of now is
to copy the same folder, a total of three
to delete files that are not used by e-commerce, blog, front-end and backend (without deleting css,js first), and I believe it is a very big project.
then divide these shared files into a fourth project? The
path may look like this

blog

/var/www/blog

EC

/var/www/ec

Front end and background

/var/www/admin

SDK? All shared feature files

/var/www/sdk

the files shared by the three projects go directly to / var / www / sdk to read the same file (but I don"t know how to do that? )
because suppose I am in ec and change all paths to start with / slash, for example, / images / xxx.png
he will only read the root folder of the ec, not from the host directory / var . In short, the above is my imagination.

do you have any experienced gods to give some advice?

May.26,2022

/ var/www/sdk are the files used at the front end? if so, there are generally two processing methods

.

the first is a newly opened site, such as sdk.xxx.com , pointing to the / var/www/sdk directory, where all common content is introduced

.

the second is apache , for example, / sdk , point to / var/www/sdk directory

.
Alias "/sdk/" "/var/www/sdk/"

make several copies, each project independent, unless open source libraries such as jquery and self-written suggestions are separated. It is convenient for later maintenance and will not cause the whole body to move in one place

.
Menu