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

    # Use browser cache to boost the website speed.
    <FilesMatch "\.(ico|pdf|jpg|jpeg|png|webp|gif|html|htm|xml|txt|xsl|css)$">
        Header set Cache-Control "max-age=31536050"
    </FilesMatch>

    RewriteEngine On

    ### Redirect a specific home page of a custom domain
    #
    # RewriteCond %{HTTP_HOST} ADD_YOURDOMAIN_HERE_WITHOUT_WWW
    # RewriteRule ^(/)?$ ADD_YOUR_NEW_HOMEPAGE_HERE [L,R=301]
    #
    ### End custom domain redirect

    ### Enforce https
    #
    # RewriteCond %{HTTPS} off
	# RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    #
	# End enfore https

    ### Enforce www
    #
    # RewriteCond %{HTTP_HOST} !^www\. [NC]
	# RewriteRule (.*) https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    #
    ### End enforce www


    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Send Requests To Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>
