Forums / General / [Resolved]Disable access by URL to media on frontend

[Resolved]Disable access by URL to media on frontend

Author Message

Alain Sahli

Friday 01 May 2009 8:54:46 am

Hello,

I did a website with a lot of images and PDF files. This files are located in the media section. I gave access for content/read("standard", "media") to the anonymous members so they can read content and media files.

But my problem is that with this configuration each user can go to www.mysite.com/Media and the media Folder is shown.

Can I disable this ?

You can have a live demo here : http://www.smsa.ch/Media ;-)

Thanks for help !

http://www.wess.ch
eZ Publish Certified developer : http://auth.ez.no/certification/verify/272583

Marco Zinn

Saturday 02 May 2009 2:26:01 am

Bonjour Alain,

i know that issue. It's probably one of "those-who-must-not-be-talked-about" ;-)
I think, you cannot do this by read-rules, as these usually refer to the objects. As soon as you disallow read access to these objects, they will not be shown in the articles...

My suggestion: you should try to override the full-view-templates of the folder class, the image class and the file class IN the media section only (override condition: "section=media")

Marco
http://www.hyperroad-design.com

Ivo Lukac

Saturday 02 May 2009 3:00:36 am

Hi,

On the other hand you can always filter out Media urls with rewrite rules in .htaccess

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Gaetano Giunta

Sunday 03 May 2009 1:41:04 am

Besides marking as invisible the Media folder, which would not work as all its children would be hidden too, you can simply set it to a "reserved" section, that is not visible to anon user (ie. he has no content/read access to that section). You then switch back to the "media" section to all children of media, and you should be done

Principal Consultant International Business
Member of the Community Project Board

Alain Sahli

Thursday 07 May 2009 2:24:19 am

I did a rewrite rule in my .htaccess file. It works fine, thanks !

http://www.wess.ch
eZ Publish Certified developer : http://auth.ez.no/certification/verify/272583