N
N
Ninazu2017-10-04 16:11:06
Apache HTTP Server
Ninazu, 2017-10-04 16:11:06

How to concatenate string in VirtualDocumentRoot?

Actually now routing works like this
The site is in

/var/www/test

if you access it, then its root is

test.html -> /var/www/test/html/index.php
test.web -> /var/www/test/web/index.php

<VirtualHost *:80>  
  ServerAlias *.(web|html)
  VirtualDocumentRoot "/var/www/%-2+/%-1"
</VirtualHost>

Almost everything suits me in this scheme. Except for the moment that I want to structurally separate such sites from the rest, that is,
so that the folder has a name
/var/www/test.loc _

Tried like this
VirtualDocumentRoot "/var/www/%-2+\.loc/%-1"
But something doesn’t work, apparently you need to somehow concatenate or escape variables and strings in a special way

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question