<IfModule mod_rewrite.c>
	Options -Indexes

	RewriteEngine On
	RewriteBase /
	# RewriteRule ^index.php$ - [L]
	
	# Enables the service worker to operate on the root scope.
	RewriteRule sw modules/webconsole/assets/worker/sw.js [END]

	# Enables PWA related files to be served from document root.
	RewriteRule manifest modules/pwa/manifest.json [END]

	# Load apple launch icons.
	RewriteRule apple-launch-(.*) modules/pwa/splash/apple-launch-$1 [END]

	# Load splash screen icons.
	RewriteRule pwa-startup-(.*) modules/pwa/splash/pwa-startup-$1 [END]

	# Load home screen icons.
	RewriteRule pwa-icons-(.*) modules/pwa/images/pwa-icons-$1 [END]

	# Load other css/scripts with the special "pwa-" prefix.
	RewriteRule pwa-(.*) modules/pwa/$1 [END]
	
	# RewriteRule . /public/app.php [L]
	
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule . /public/app.php [L]
</IfModule>

<IfModule mod_headers.c>
	Header set Access-Control-Allow-Origin "*"
	Header set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
	Header set Access-Control-Max-Age "1000"
	Header set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"
</IfModule>
