How To Set Sites In Apache For Advanced App

I want to setup an advanced app.

Say I have one domain e.g. www.example.com

I use virtuell hosts on my apache 2.4

I want that users can see my frontend by www.example.com and my backend by www.example.com/backend

Must I setup two different sites-avaiable with different document roots.

To simulate a domain

I create a new host in my windows host file (domain): 127.0.0.1 fewo_yii2_advanced

I create a new host in my windows host file (subdomain): 127.0.0.1 backend.fewo_yii2_advanced

then I create my vhosts under apache conf




<VirtualHost 127.0.0.1:80>

	ServerName fewo_yii2_advanced

	ServerAlias 127.0.0.1

	DocumentRoot c:/www/fewo_yii2_advanced/frontend/web

</VirtualHost>


<VirtualHost 127.0.0.1:80>

	ServerName backend.fewo_yii2_advanced

	ServerAlias 127.0.0.1

	DocumentRoot c:/www/fewo_yii2_advanced/backend/web

</VirtualHost>



This worked well as expected for my front- and backend, but I don’t know what to do when I want to reach my backend without a subdomain under fewo_yii_advanced/backend.