ServerName livetrail.localhost
DocumentRoot /var/www/html/
DirectoryIndex index.php
# Serve http://livetrail.localhost/ from the public web root.
Alias /livetrail /var/www/html/livetrail/public
Options FollowSymLinks
AllowOverride None
Require all granted
AddType application/geo+json .geojson
Header set Cache-Control "public, max-age=31536000, immutable"
AddOutputFilterByType BROTLI_COMPRESS \
text/html \
text/plain \
text/css \
text/javascript \
text/xml \
application/javascript \
application/json \
application/geo+json \
application/manifest+json \
application/xml \
image/svg+xml
AddOutputFilterByType DEFLATE \
text/html \
text/plain \
text/css \
text/javascript \
text/xml \
application/javascript \
application/json \
application/geo+json \
application/manifest+json \
application/xml \
image/svg+xml
# Geo (WMTS cache service). Told apart from Live Trail by host name;
# *.localhost resolves to 127.0.0.1 without touching /etc/hosts.
# Needs: a2enmod rewrite headers proxy_fcgi setenvif
ServerName geo.localhost
# The project root also holds vendor/, config/settings.php, lib/ and .git,
# so only index.php and favicon.ico are reachable; everything else is
# rewritten to the front controller below.
DocumentRoot /var/www/html/geo
Options FollowSymLinks
AllowOverride None
Require all granted
# CORS: Live Trail (browser) calls Geo cross-origin. "always" so the headers
# are also sent on 403/404/5xx, otherwise the browser reports a CORS error
# instead of the real status.
Header always set Access-Control-Allow-Origin "http://livetrail.localhost"
Header always set Access-Control-Allow-Methods "GET, POST, OPTIONS"
Header always set Access-Control-Allow-Headers "Content-Type, Authorization, X-Requested-With"
Header always set Access-Control-Max-Age "86400"
RewriteEngine on
# Preflight is answered here, without hitting PHP
RewriteCond %{REQUEST_METHOD} =OPTIONS
RewriteRule ^ - [R=204,END]
# Every request (?a=tile&id=...&x=..&y=..&z=..) goes through the front controller
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteCond %{REQUEST_URI} !=/index.php
RewriteRule ^ /index.php [END,QSA]