forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 permissions => Topic started by: jonahnaylor on November 26, 2011, 07:29:04 pm

Title: Block access to directorie
Post by: jonahnaylor on November 26, 2011, 07:29:04 pm
Hi does anyone know how to block access to directories such as album/uploads?

I've managed to put a .htaccess file together so if you put a full path of an image in it redirects to front page of the site but I'd like it to include dirs as when you navigate to the album/uploads path all the images are listed which can be clicked on and viewed?

If anyone can please help thanks.

I also have a redirect so that people putting the subdomain address and not the full domain in get redirected, however i'd also like to include those visiting from newdomain.co.uk/olddomain to be redirected to www.newdomain.co.uk too. Can anyone tell me the cleanest way to add these alterations and also stop visitors being able to view my original files in folders?

Currently my .htaccess looks like this:

Code: [Select]
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://www.newdomain.co.uk/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.newdomain.co.uk$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.newdomain.co.uk/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.newdomain.co.uk$      [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp.*.*jpg|jpeg|gif|png|bmp)$ http://www.yorkstockphotos.co.uk [R,NC]
RewriteCond %{HTTP_HOST} ^olddomain\.newdomain\.co\.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www\.olddomain\.newdomain\.co\.uk$
RewriteRule ^/?$ "http\:\/\/www\.newdomain\.co\.uk\/" [R=301,L]

Thanks for any help.
Title: Re: Block access to directorie
Post by: Αndré on November 28, 2011, 04:24:41 pm
when you navigate to the album/uploads path all the images are listed which can be clicked on and viewed?
Just disable directory listing with the help of your .htaccess file:
Code: [Select]
Options -Indexes