Merge pull request #152 from open-sausages/pulls/4.0/disable-trailing-slash-redirect

Disable trailing slash redirect for dirs
This commit is contained in:
Daniel Hensby 2017-02-02 10:10:47 +00:00 committed by GitHub
commit 5d778fa2a5

View File

@ -35,6 +35,7 @@ ErrorDocument 500 /assets/error-500.html
# Turn off index.php handling requests to the homepage fixes issue in apache >=2.4 # Turn off index.php handling requests to the homepage fixes issue in apache >=2.4
<IfModule mod_dir.c> <IfModule mod_dir.c>
DirectoryIndex disabled DirectoryIndex disabled
DirectorySlash Off
</IfModule> </IfModule>
SetEnv HTTP_MOD_REWRITE On SetEnv HTTP_MOD_REWRITE On
@ -42,19 +43,19 @@ ErrorDocument 500 /assets/error-500.html
# Enable HTTP Basic authentication workaround for PHP running in CGI mode # Enable HTTP Basic authentication workaround for PHP running in CGI mode
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Deny access to potentially sensitive files and folders # Deny access to potentially sensitive files and folders
RewriteRule ^\.env - [F,L,NC] RewriteRule ^\.env - [F,L,NC]
RewriteRule ^vendor(/|$) - [F,L,NC] RewriteRule ^vendor(/|$) - [F,L,NC]
RewriteRule silverstripe-cache(/|$) - [F,L,NC] RewriteRule silverstripe-cache(/|$) - [F,L,NC]
RewriteRule composer\.(json|lock) - [F,L,NC] RewriteRule composer\.(json|lock) - [F,L,NC]
# Process through SilverStripe if no file with the requested name exists. # Process through SilverStripe if no file with the requested name exists.
# Pass through the original path as a query parameter, and retain the existing parameters. # Pass through the original path as a query parameter, and retain the existing parameters.
RewriteCond %{REQUEST_URI} ^(.*)$ RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* framework/main.php?url=%1 [QSA] RewriteRule .* framework/main.php?url=%1 [QSA]
# If framework isn't in a subdirectory, rewrite to installer # If framework isn't in a subdirectory, rewrite to installer
RewriteCond %{REQUEST_URI} ^(.*)/framework/main.php$ RewriteCond %{REQUEST_URI} ^(.*)/framework/main.php$
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-f