Installation : Frontoffce - Configuration Apache2 pour le frontoffice

Exemple de configuration d'apache pour un frontoffice.

Voici un exemple de configuration Apache pour un frontoffice :

<Virtualhost *:80>
    ServerName front.demo.gabox.io
    SetEnv id_site 1
    SetEnv front 1
    SetEnv usr gabox-demo
    setEnv env prod

    DocumentRoot /var/www/gabox-demo/usr/gabox-demo/www/
    DirectoryIndex index.php

    php_admin_value auto_prepend_file   "/var/www/gabox-demo/gabox/autoprepend.php"
    php_admin_value auto_append_file    "/var/www/gabox-demo/gabox/autoappend.php"

    RewriteEngine on

    # gateway front and back media directory 
    RewriteRule ^/media/usr/([^/]*)/var/upload/data/files/(.*)$  /media/$2 [P,L]

    # rewrite to virtual url to index.php controller 
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [QSA]

    <Directory "/var/www/gabox-demo/usr/gabox-demo/www/">
        AllowOverride All
        Options -Indexes
    </Directory>

</VirtualHost>