#Version 1.06
# Changed routing parameter from 'path' to '__route' to avoid conflicts

<Directory /var/www/html/{{SITE_NAME}}/public_html>
        Options -Indexes +FollowSymLinks -MultiViews
        AllowOverride All
        Require all granted
	# Turn mod_rewrite on
	RewriteEngine On
	RewriteBase /
	
    RewriteCond %{REQUEST_URI} !^/serve\.php$
    RewriteRule ^(.*)$ serve.php?__route=$1 [QSA,L]

</Directory>

<Directory /var/www/html/{{SITE_NAME}}_test/public_html>
        Options -Indexes +FollowSymLinks -MultiViews
        AllowOverride All
        Require all granted
	# Turn mod_rewrite on
	RewriteEngine On
	RewriteBase /

    RewriteCond %{REQUEST_URI} !^/serve\.php$
    RewriteRule ^(.*)$ serve.php?__route=$1 [QSA,L]

</Directory>

<VirtualHost {{SERVER_IP}}:80>

		# Static files alias for public assets
		Alias /static_files /var/www/html/{{SITE_NAME}}/static_files
		<Directory "/var/www/html/{{SITE_NAME}}/static_files">
			Options -Indexes
			AllowOverride None
			Require all granted
		</Directory>


        ServerName {{DOMAIN_NAME}}
        DirectoryIndex index.php index.html
        DocumentRoot /var/www/html/{{SITE_NAME}}/public_html
        ErrorLog /var/www/html/{{SITE_NAME}}/logs/error.log
        CustomLog /var/www/html/{{SITE_NAME}}/logs/access.log combined
</VirtualHost>

<VirtualHost {{SERVER_IP}}:80>
        ServerName test.{{DOMAIN_NAME}}
        DirectoryIndex index.php index.html
        DocumentRoot /var/www/html/{{SITE_NAME}}_test/public_html
        ErrorLog /var/www/html/{{SITE_NAME}}_test/logs/error.log
        CustomLog /var/www/html/{{SITE_NAME}}_test/logs/access.log combined
</VirtualHost>