<IfModule mod_rewrite.c>
    RewriteEngine On

    # Redirect non-www to www
    RewriteCond %{HTTP_HOST} ^urbanmop\.online [NC]
    RewriteRule ^(.*)$ https://www.urbanmop.online/$1 [L,R=301]

    # Ensure Laravel URLs work without "public"
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ public/index.php/$1 [L,QSA]


    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

    # Disable index view
    Options -Indexes

    # Hide sensitive files
    <Files .env>
        Order allow,deny
        Deny from all
    </Files>
    <Files "apple-app-site-association">
        ForceType 'application/json'
    </Files>

    ## EXPIRES CACHING ##
    <IfModule mod_expires.c>
        ExpiresActive On
        ExpiresByType image/jpg "access plus 1 year"
        ExpiresByType image/jpeg "access plus 1 year"
        ExpiresByType image/gif "access plus 1 year"
        ExpiresByType image/png "access plus 1 year"
        ExpiresByType text/css "access plus 1 month"
        ExpiresByType text/x-javascript "access plus 1 month"
        ExpiresByType application/x-shockwave-flash "access plus 1 month"
        ExpiresByType image/x-icon "access plus 1 year"
        ExpiresDefault "access plus 1 days"
    </IfModule>

</IfModule>

# Set PHP version
<IfModule mime_module>
    AddHandler application/x-httpd-ea-php74 .php .php7 .phtml
</IfModule>

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php74” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php74 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
