Block access to directorie Block access to directorie
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Block access to directorie

Started by jonahnaylor, November 26, 2011, 07:29:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jonahnaylor

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:

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.

ΑndrĂ©

Quote from: jonahnaylor on November 26, 2011, 07:29:04 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:
Options -Indexes