diff --git a/.htaccess b/.htaccess index a3c540c..305df2f 100644 --- a/.htaccess +++ b/.htaccess @@ -1,32 +1,24 @@ - - Options -MultiViews -Indexes - - + Options -MultiViews -Indexes RewriteEngine On - # Preserve Authorization header for API/auth - RewriteCond %{HTTP:Authorization} . - RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] - # Redirect any requests for /home/... static files into the public/home folder - RewriteCond %{REQUEST_URI} !^/public/ - RewriteCond %{REQUEST_URI} ^/home/.*\.(css|js|png|jpe?g|gif|svg|ico|woff2?|ttf|eot|otf|webp)$ [NC] - RewriteRule ^(.*)$ public/$1 [L] + RewriteRule ^home/(.+\.(?:css|js|png|jpe?g|gif|svg|ico|woff2?|ttf|eot|otf|webp))$ public/home/$1 [L] + - # Serve existing files and directories directly RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] - # Remove trailing slashes for non-directories - RewriteCond %{REQUEST_FILENAME} !-d - RewriteRule ^(.+)/$ /$1 [L,R=301] - # All other requests go to Laravel's front controller + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule ^(.+)/$ /$1 [R=301,L] + + RewriteRule ^ index.php [L] - + + # ensure LSAPI for PHP SetHandler application/x-lsphp81 diff --git a/public/.htaccess b/public/.htaccess index a3c540c..df2d8fd 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -1,32 +1,15 @@ - - Options -MultiViews -Indexes - - + Options -MultiViews -Indexes RewriteEngine On - # Preserve Authorization header for API/auth - RewriteCond %{HTTP:Authorization} . - RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] - - # Redirect any requests for /home/... static files into the public/home folder - RewriteCond %{REQUEST_URI} !^/public/ - RewriteCond %{REQUEST_URI} ^/home/.*\.(css|js|png|jpe?g|gif|svg|ico|woff2?|ttf|eot|otf|webp)$ [NC] - RewriteRule ^(.*)$ public/$1 [L] - - # Serve existing files and directories directly - RewriteCond %{REQUEST_FILENAME} -f [OR] - RewriteCond %{REQUEST_FILENAME} -d - RewriteRule ^ - [L] - - # Remove trailing slashes for non-directories + # If the file or folder exists, serve it + RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d - RewriteRule ^(.+)/$ /$1 [L,R=301] - # All other requests go to Laravel's front controller + # Otherwise rewrite to index.php RewriteRule ^ index.php [L] - + SetHandler application/x-lsphp81