Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Block access to directorie  (Read 4422 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.02 seconds with 19 queries.