Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Block access to directorie  (Read 4383 times)

0 Members and 1 Guest are viewing this topic.

jonahnaylor

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Block access to directorie
« 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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Block access to directorie
« Reply #1 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
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 19 queries.