Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

secure the assets folder


Reply

19 Posts   5497 Views

Avatar
malinux

22 September 2009 at 9:17am Community Member, 23 Posts

My .htaccess in a secure folder ends up like this:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteRule (.*) sapphire/main.php?url=%1&%{QUERY_STRING} [L]

Avatar
x75

22 September 2009 at 11:31pm Community Member, 42 Posts

Hi, thanks for your answer.

That is exactly what my .htaccess file looks like. Maybe I have a config error somewhere else?

Just in case, this is my .htaccess file in the root of this web:

### SILVERSTRIPE START ###
<Files *.ss>
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Files>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} !(\.gif$)|(\.jpg$)|(\.png$)|(\.css$)|(\.js$)

RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
</IfModule>
### SILVERSTRIPE END ###

Any Idea where else I could search for a solution?

Thanks
Johannes

Avatar
x75

23 September 2009 at 10:49pm Community Member, 42 Posts

Ok, I found something:
http://www.silverstripe.org/installing-silverstripe/show/254742?start=8#post260586

The Problem seems to be the way SS handles nested Folders in 2.3

But after changing the code as suggested, my image_gallery broke. Now it won't resample Images in secured folders. I remerber reading about a problem with resampled images and security on this forum, but I can't find it anymore.

Any help would be great!

Thanks
Johannes