DirectoryIndex app.php

<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
    RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

	RewriteCond %{HTTPS} !=on
	RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
	
    RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
    RewriteRule ^(.*) - [E=BASE:%1]

    # Generowanie miniatur plików.
    RewriteCond %{REQUEST_URI} ^/media/assets/
    RewriteCond %{QUERY_STRING} ^thumb=(\d+)x(\d+)$
    RewriteRule (.*) %{ENV:BASE}/_thumb/%1/%2/$1 [R=302,L]

    RewriteCond %{HTTP:Authorization} .
    RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    RewriteCond %{ENV:REDIRECT_STATUS} ^$
    RewriteRule ^app\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^ - [L]

    RewriteRule ^ %{ENV:BASE}/app.php [L]
</IfModule>

<IfModule !mod_rewrite.c>
    <IfModule mod_alias.c>
        RedirectMatch 302 ^/$ /app.php/
    </IfModule>
</IfModule>

<FilesMatch ".(jpg|jpeg|png|gif|tiff|ico)$">
    Header set Cache-Control "max-age=900, public, s-maxage=900"
</FilesMatch>
<FilesMatch ".(js)$">
    Header set Cache-Control "max-age=900, public, s-maxage=900"
</FilesMatch>
<FilesMatch ".(css)$">
    Header set Cache-Control "max-age=900, public, s-maxage=900"
</FilesMatch>
<FilesMatch ".(pdf)$">
    Header set Cache-Control "max-age=900, public, s-maxage=900"
</FilesMatch>
