Public url for assets when logged-in I'm creating a website where I want users to be able to login. I'm using https://craftcms.com/docs/templating/login-form to achieve this. No problem so far.

When a user is logged in, I want the user to be able to reach the asset folder (depending on what the rights are for his user-group). When not logged in, I want the asset url to be private.
For this to work I've placed the asset folder outside the webroot, so you can't access the asset folder by default.

I've tried to achieve this with this plugin: https://github.com/tikiatua/internal-assets-plugin
But without any success.

My general config:

'enableTemplateCaching' =&gt; false,
    'devMode' =&gt; true,
    'siteUrl' =&gt; 'http://website.loc/',
    'loginPath' =&gt; 'http://website.loc/',
    'environmentVariables' =&gt; array(
        'internalAssetsPath' =&gt; CRAFT_BASE_PATH . "../media/",
        'internalAssetsUrl' =&gt; "http://website.loc/media/"
    )


I can upload a image in my internalAssetsPath, but when I try to show this in front-end, I get a 404.

{% for image in craft.assets.kind('image') %}
        &lt;li&gt;&lt;img src="{{ image.getUrl() }}" alt="{{ image.title }}"&gt;&lt;/li&gt;
{% endfor %}


A solution for the 404 problem would be nice, but a solution for reaching the asset folder when logged in would be great.
Give Digital Download a try... it generates a masked URL for downloadable assets. You can restrict the download to a specific user or user group. 

Disclaimer: I'm the plugin author.