Hiding folders from displaying in browser


(Mitch Kerry) #1

Hi

This might be a simple one.
Is there a way to stop folders that hold assets from displaying in the browser?
An example, we have a site called ‘media’ that has an ‘images’ folder…this folder can then be viewed at /media/images, which brings up a blank page.
Is there a way to stop that URL from being accessible while still allowing the children assets to be available?

Thanks
Mitch


(Peter McLeod) #2

Hi

If the assets are image or file assets that are using /__data url, then you can just either move the folder outsite of the site asset that has the domain applied to, or you could delete the webpath for the folder.

If the assets use the Matrix asset path (rather than the /__data urls) you could set a remap for /media/images or possibly replace the folder with a redirect asset with have the images/assets as children of this?

Thanks
Peter


(Mitch Kerry) #3

Thanks Peter

The images aren’t using the /__data and I tried remapping the parent folder but it wouldn’t let me.
I’ve use the redirect asset parent trick before so I might have to resort to doing that again.

Mitch


(Dcook) #4

The way I’d generally handle this is to use a paint layout folder type format which automatically redirects to the parent. This way it can be easily applied to a whole section, but only modify the behaviour of folder assets.

In the Folder Format, (from memory) you can simply add some redirect code which points to “…/”, or make use of the new %asset_parent% keyword.