<IfModule mod_rewrite.c>



<IfModule mod_negotiation.c>

Options -MultiViews

</IfModule>



RewriteEngine On

# Prevent direct access to the "public" folder - redirect to root

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /public/

RewriteRule ^public/(.*) /$1 [R=302,L]



# Redirect Trailing Slashes If Not A Folder...

# - but look for the file in the "public" folder

# (ensure we are not already in the "public" folder)

RewriteCond %{REQUEST_URI} !^/public/

RewriteCond %{DOCUMENT_ROOT}/public/$1 !-d

RewriteRule ^(.*)/$ /$1 [R=302,L]



# Rewrite "everything" to the "public" subdirectory if not already

# This ignores existing files/dirs in the document root

RewriteCond %{REQUEST_URI} ^/(.*)

RewriteRule !^public/ public/%1



# Handle Front Controller... (as before)

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^ index.php [L]

</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
