#5870 Block web requests to silverstripe-cache directory via htaccess RedirectMatch rule or web.config hiddenSegments functionality if using IIS 7.x (from r110241)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/trunk@112417 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
sminnee 2010-10-15 01:19:01 +00:00
parent dfbd3e08f6
commit 5a20fbed64
2 changed files with 15 additions and 0 deletions

View File

@ -13,6 +13,10 @@
ErrorDocument 404 /assets/error-404.html ErrorDocument 404 /assets/error-404.html
ErrorDocument 500 /assets/error-500.html ErrorDocument 500 /assets/error-500.html
<IfModule mod_alias.c>
RedirectMatch 403 /silverstripe-cache(/|$)
</IfModule>
<IfModule mod_rewrite.c> <IfModule mod_rewrite.c>
RewriteEngine On RewriteEngine On
RewriteCond %{REQUEST_URI} ^(.*)$ RewriteCond %{REQUEST_URI} ^(.*)$

View File

@ -1122,6 +1122,10 @@ HTML;
ErrorDocument 404 /assets/error-404.html ErrorDocument 404 /assets/error-404.html
ErrorDocument 500 /assets/error-500.html ErrorDocument 500 /assets/error-500.html
<IfModule mod_alias.c>
RedirectMatch 403 /silverstripe-cache(/|$)
</IfModule>
<IfModule mod_rewrite.c> <IfModule mod_rewrite.c>
RewriteEngine On RewriteEngine On
$baseClause $baseClause
@ -1156,6 +1160,13 @@ TEXT;
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<system.webServer> <system.webServer>
<security>
<requestFiltering>
<hiddenSegments applyToWebDAV="false">
<add segment="silverstripe-cache" />
</hiddenSegments>
</requestFiltering>
</security>
<rewrite> <rewrite>
<rules> <rules>
<rule name="SilverStripe Clean URLs" stopProcessing="true"> <rule name="SilverStripe Clean URLs" stopProcessing="true">