Open directories Open directories
 

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

Open directories

Started by bree, May 04, 2005, 10:13:07 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bree

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.

Tranz

Create a file called .htaccess and put it into the albums folder. In the file, put the following line:
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.

nol33t

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

<meta http-equiv="refresh" content="0; url=../index.php">

with

<meta http-equiv="refresh" content="0; url=../../index.php">


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


<!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

Thanks so much! :) It works perfectly.

nol33t

@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

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.