Score:0

Can I make a folder on a vhost access a site held in another vhost?

in flag

I have two website codebases running on a domain as follows

www.example.com (a WordPress site) Exists at: /var/www/example.com/public_html

whitelabel.example.com (a Laravel site) Exists at: /var/www/whitelabel.example.com/public_html

As you can see from the server folder structure, these are held in two different virtual hosts.

We need to start making international language translations of our main website and it makes sense to use our white label codebase. This means that when a user accesses www.example.com/de/ I want it to be processed by the Laravel codebase.

Note that it's vital that a redirect doesn't occur for SEO purposes.

So if the white label website has a page such as test, I would expect www.example.com/de/test/ to be accessible without any kind of redirect occurring.

Is what I want to do possible under Apache or is it against the basic ideas of how the architecture of the platform works ?

This is an ISP provided VPS platform and the amount of changes I can make are limited. Is there anything I can do for this ?

cn flag
EML
If you're just talking about Apache `VirtualHost`- this just sets a `DocumentRoot`. You can symlink files in any way you want to move outside `DocumentRoot`, or do a rewrite rule to map one address to another. But if your ISP has your sites running on different VMs, or you're in chroot jail, then I think you're stuck with a redirect.
Score:1
st flag

It's an architectural decision. You're supposed to decouple responsibilities and use some API or microservices for processing different domains of business logic.

In other words, when the website www.example.com is accessed and you want it to have it processed by another application, place this application on a separate API or microservice, and preferably, on a specific container. This way, your www.example.com website can reach other endpoints like https://api.example.com/translator

This way, you're building a decoupled application. If your business and traffic grow and the translator API starts overloading your server, you can move it to another instance behind a load balancer, without the need to touch your main website.

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.