From a237037ade8ed6ad409172b13dc6ee1e2de65e91 Mon Sep 17 00:00:00 2001 From: printempw Date: Wed, 25 Jul 2018 15:29:50 +0800 Subject: [PATCH] Update .htaccess --- .htaccess | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/.htaccess b/.htaccess index d01bce0a..62dcb4d6 100644 --- a/.htaccess +++ b/.htaccess @@ -1,10 +1,26 @@ -RewriteEngine On + + + Options -MultiViews -Indexes + -RewriteBase / + RewriteEngine On -RewriteRule (^\.|/\.) - [F] + # You may need to uncomment the following line for some hosting environments, + # if you have installed to a subdirectory, enter the name here also. + # + # RewriteBase / -RewriteCond %{REQUEST_FILENAME} !-f -RewriteCond %{REQUEST_FILENAME} !-d + # Black list protected files + RewriteRule (^\.|/\.) - [F] + RewriteRule ^storage/.* - [F] -RewriteRule ^.*$ index.php [L] + # Redirect trailing slashes if not a folder + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_URI} (.+)/$ + RewriteRule ^ %1 [L,R=301] + + # Handle front controller + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^ index.php [L] +