Esempio:
abbiamo gia’ impostato il sito example.com in /var/www/webX/clientY/web
Vogliamo impostare il sottodominio subdomain.example.com nella cartella /var/www/webX/clientY/web/subdomain
La cosa potrebbe essere gestita dal pannello (Siti->Siti->Sottodomini) pero’ un bug di ispconfig (pare risolto nelle ultime versioni ma non ne ho conferma) non consente di gestire correttamente i sottodomini in sottodirectory se si utilizza PHP-FPM.
Il problema si risolve gestendo la cosa da Siti->Siti->example.com->Opzioni.
Bisogna inserire nel box Apache directives:
ServerAlias subdomain.example.com
ServerAlias www.subdomain.example.com
RewriteEngine on
RewriteCond %{HTTP_HOST} ^subdomain.example.com$ [NC]
RewriteCond %{REQUEST_URI} !^/webdav/
RewriteCond %{REQUEST_URI} !^/php5-fcgi/
RewriteCond %{REQUEST_URI} !^/subdomain/
RewriteRule ^/(.*)$ /subdomain/$1 [L]
RewriteCond %{HTTP_HOST} ^www.subdomain.example.com$ [NC]
RewriteCond %{REQUEST_URI} !^/webdav/
RewriteCond %{REQUEST_URI} !^/php5-fcgi/
RewriteCond %{REQUEST_URI} !^/subdomain/
RewriteRule ^/(.*)$ /subdomain/$1 [L]
e salvare. Dopo circa un minuto potrete provare la nuova configurazione.
N.B.: le due righe RewriteCond %{REQUEST_URI} !^/php5-fcgi/ sono necessarie solo per l’utilizzo con PHP-FPM