USE SOMENTE se não puder mudar o Document Root para /public. Copie TUDO abaixo para o .htaccess da raiz do subdomínio, mantendo o bloco do cPanel e colocando as regras DEPOIS dele (fora do bloco BEGIN/END, para o editor MultiPHP do cPanel não apagar). NÃO foi testado em Apache real. ---------------------------------------------------------------------- # BEGIN cPanel-generated php ini directives, do not edit # Manual editing of this file may result in unexpected behavior. # To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor) # For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI) php_value error_log "/home2/caserna/logs/php.error.log" php_flag log_errors On php_value error_log "/home2/caserna/logs/php.error.log" php_flag log_errors On # END cPanel-generated php ini directives, do not edit # --- Cross Analyser: bloqueio de arquivos privados --- Options -Indexes RewriteEngine On RewriteCond %{REQUEST_URI} !^/\.well-known/ RewriteRule ^(app|config|database|storage|tests|docs|routes|bin|resources|vendor)(/|$) - [F,L] RewriteCond %{REQUEST_URI} !^/\.well-known/ RewriteRule (^|/)\.(?!well-known) - [F,L] RewriteRule \.(env|sql|log|md|lock)$ - [F,L] RewriteCond %{REQUEST_URI} !^/\.well-known/ RewriteCond %{REQUEST_URI} !^/public/ RewriteRule ^(.*)$ public/$1 [L]