| | 62 | Conditionals vs. simple-vhost |
| | 63 | ----------------------------- |
| | 64 | |
| | 65 | You have to keep in mind that conditionals and simple-vhost interfere. :: |
| | 66 | |
| | 67 | simple-vhost.server-root = "/var/www/servers/" |
| | 68 | simple-vhost.default-host = "www.example.org" |
| | 69 | simple-vhost.document-root = "pages" |
| | 70 | |
| | 71 | $HTTP["host"] == "news.example.org" { |
| | 72 | server.document-root = "/var/www/servers/news2.example.org/pages/" |
| | 73 | } |
| | 74 | |
| | 75 | Even if the ``server.document-root`` will be set to ``/var/www/servers/news2.example.org/pages/`` |
| | 76 | if ``news.example.org`` is requested simple-vhost will overwrite ``server.document-root`` shortly |
| | 77 | afterwards. |
| | 78 | |
| | 79 | If ``/var/www/servers/news.example.org/pages/`` exists it will be taken, if not |
| | 80 | ``/var/www/servers/www.example.org/pages/`` will be taken as it is the default. |
| | 81 | |
| | 82 | To get them working in parallel you should use: :: |
| | 83 | |
| | 84 | $HTTP["host"] !~ "^(news\.example\.org)$" { |
| | 85 | simple-vhost.server-root = "/var/www/servers/" |
| | 86 | simple-vhost.default-host = "www.example.org" |
| | 87 | simple-vhost.document-root = "pages" |
| | 88 | } |
| | 89 | |
| | 90 | $HTTP["host"] == "news.example.org" { |
| | 91 | server.document-root = "/var/www/servers/news2.example.org/pages/" |
| | 92 | } |
| | 93 | |
| | 94 | It will enable simple-vhosting for all host with are not named ``news.example.org``. |
| | 95 | |