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: Open directories  (Read 5927 times)

0 Members and 1 Guest are viewing this topic.

bree

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Open directories
« on: May 04, 2005, 10:13:07 am »

Is there a way to stop people access the image directories on my site. A forum recently posted links to folders within my server so they could bypass the coppermine register only. For example:

http://www.michelletrachtenberg.net/gallery/albums/caps/
http://www.michelletrachtenberg.net/gallery/albums/icepremiere/

It allows all the folders and images within there to be accessed. If you go to http://www.michelletrachtenberg.net/gallery/albums it says it is unallowed which is what I want, is there a way to make that work for all the folders within the albums directory? I have bandwidth problems so I want people to register in order to be able to view pictures to help reduce the bandwidth usage.
« Last Edit: February 23, 2006, 07:43:21 am by GauGau »
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Open directories
« Reply #1 on: May 04, 2005, 04:48:38 pm »

Create a file called .htaccess and put it into the albums folder. In the file, put the following line:
Code: [Select]
Options -Indexes
I think this works with apache only.

You would also need to enable hotlink protection so that people cannot access the files directly if they know the URL to them. I posted the code for that so you should try searching.
Logged

nol33t

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 244
  • Exploring Coppermine in every directions
    • tieum's pics
Re: Open directories
« Reply #2 on: May 04, 2005, 05:40:04 pm »

a non web server dependent solution is to place in your sub albums directories an index.html file, the same that is in your albums directory:
you only got to change the line
Code: [Select]
<meta http-equiv="refresh" content="0; url=../index.php">
with
Code: [Select]
<meta http-equiv="refresh" content="0; url=../../index.php">

---------------------------

Code: [Select]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Coppermine Photo Gallery - Albums Folder</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="refresh" content="0; url=../../index.php">
<style type="text/css">
<!--
body {
        font-family : Verdana, Arial, Helvetica, sans-serif;
        font-size: 12px;
        background : #F7F7F7 ;
        color : Black;
        margin: 20px;
}

h1{
        font-weight: bold;
        font-size: 22px;
        font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
        text-decoration: none;
        line-height : 120%;
        color : #000000;
}

p {
        font-family : Verdana, Arial, Helvetica, sans-serif;
        font-size: 12px;
        margin: 10px 10px 0px 0px;
}

-->
</style>

<!--
$Id: index.html,v 1.2 2004/06/11 12:19:25 tarique Exp $
-->
</head>

<body>
<h1><img src="../images/coppermine_logo.png" width="300" height="75" /></h1>
<h1>Coppermine Photo Gallery - Albums Folder</h1>
<p align="center">The contens of this folder aren't meant to be browsed. Visit the Coppermine Photo Gallery instead - you'll be redirected.
If you don't want to wait (or your browser doesn't support redirect), click <a href="../index.php">here</a>.</p>

</body>
</html>

bree

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: Open directories
« Reply #3 on: May 07, 2005, 10:52:46 am »

Thanks so much! :) It works perfectly.
Logged

nol33t

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 244
  • Exploring Coppermine in every directions
    • tieum's pics
Re: Open directories
« Reply #4 on: May 07, 2005, 12:20:06 pm »

@bree: you did it for the "caps" but not "icepremiere" one is it normal?

@DevTeam: I'm using that trick on my own website too.
in the batch add script, when you add pictures from an album sub-directory, maybe it would be good to create this "index.html" in it automatically? ( check first if there's one, and if no create one )

-matt-

nike

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Open directories
« Reply #5 on: February 22, 2006, 09:23:51 pm »

en fait, il suffit de faire ça :

Create a file called .htaccess and put it into the albums folder. In the file, put the following line:

Code:
Options -Indexes

et ça marche nickel pour tous les albums...

merci pour tout.
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 20 queries.