Score:0

Isolating a WordPress wesbite within a sub-directory of another

ls flag

Is it possible to isolate a website within a sub-directory of another on a WHM server? And by isolate, I mean in the event that website within the sub-directory is compromised any malware is contained to that site and cannot affect anything within the parent directory.

Some background to the question...

There are 2 WordPress websites:

  • primary.com (WP1)
  • secondary.com (WP2)

And as part of an SEO strategy we have be tasked with migrating WP2 into a sub-directory of WP1 and we will then redirect the old domain to the new sub-directory e.g. secondary.comprimary.com/secondary.

This is doable, however, I'm concerned about the security of WP2 and don't want it affect WP1 so want to keep them separated as much as possible.

This isn't my area of expertise but my initial thinking is to create a separate account within WHM and some how point the sub-directory of WP1 to the newly created account directory.

Any help would be appreciated.


Edit

I've just discovered PHP's open_basedir which might be the solution.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.