Enable Access to Directory Listings?

Permalink
Hello -

I used to put a folder in my root folder called images where I would then add images directly so that I could use them on other websites and forums, etc.

After upgrading to Concrete 5.5.2.1, it seems Concrete is redirecting all my links and sends me to a Page not found error when I try to go tohttp://www.mysite.com/images/.

Is there something I can change or add to the index.php or htaccess file to enable viewing a directory listing?

I have pretty urls enabled, but I did before as well.

Thanks!
Amanda

dbrimm
 
Remo replied on at Permalink Reply
Remo
That could be caused by a .htaccess file. The default concrete5 writes, checks if the directory (or file) exists and doesn't pass the request on to index.php

Look at these two rules:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d


The first makes sure that the requests is continued if it's not a file and the second if it's not a directory. In your case, apache shouldn't even get to RewriteRule.

Can you please check your .htaccess file? However, I don't really see why something like this should have changed in 5.5.2.1 )-:
dbrimm replied on at Permalink Reply
dbrimm
I haven't had a chance to check this yet. Just wanted to say thanks for responding - I'll report back with how it goes!
elyon replied on at Permalink Reply
elyon
I believe that Concrete now blocks access to directory listings by default.

In general, this is a good behavior -- allowing users to browse the contents of your /package or other core directories doesn't seem like good form.

For anyone who may come through with this same need -- enabling directory listings, but only for certain folders -- here's what worked:

RewriteCond ${REQUEST_URI} !^/(builds|releases)


You can add this in the rewrite conditions, along with the others. This means that it will not redirect requests to "/builds" or "/releases", since those are the directories I wanted to expose. You can use your own names there, separated by the vertical bar, for directories you want to allow listings for.

Hope this helps!