# Istanza VTE Cresqo
# Hostname: vte-cresqo.mypantarei.net (alias transitorio: vte-cresco)
<VirtualHost *:80>

    ServerAdmin admin@mypantarei.net
    ServerName vte-cresqo.mypantarei.net
    ServerAlias vte-cresco.mypantarei.net

    DocumentRoot /var/www/html/vtecresco/vte/

    ErrorLog ${APACHE_LOG_DIR}/vtecresco-error.log
    CustomLog ${APACHE_LOG_DIR}/vtecresco-access.log combined

<Directory "/var/www/html/vtecresco/vte/">

    Options +ExecCGI -Indexes +FollowSymLinks +MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
    Require all granted

    <FilesMatch \.php$>
        SetHandler "proxy:unix:/run/php/php8.3-fpm.sock|fcgi://localhost/"
    </FilesMatch>

</Directory>

# Redirect HTTPS (escludere ACME per Let's Encrypt sul nuovo nome)
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/
RewriteCond %{SERVER_NAME} =vte-cresqo.mypantarei.net [OR]
RewriteCond %{SERVER_NAME} =vte-cresco.mypantarei.net
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
